-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (31 loc) · 1.11 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Release
on:
release:
types: [published]
permissions:
packages: write
contents: write
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Lowercase org/repo
shell: bash
id: lowercaserepo
run: |
GH_REPO=${{ github.repository }}
echo "REPO_LC=${GH_REPO,,}" >> $GITHUB_OUTPUT
- name: Checkout repository
uses: actions/checkout@v4
- name: "Login to GitHub Container Registry"
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: "Build image"
run: |
docker build . --tag ghcr.io/${{ steps.lowercaserepo.outputs.REPO_LC }}:latest
docker push ghcr.io/${{ steps.lowercaserepo.outputs.REPO_LC }}:latest
docker tag ghcr.io/${{ steps.lowercaserepo.outputs.REPO_LC }}:latest ghcr.io/${{ steps.lowercaserepo.outputs.REPO_LC }}:${{ github.event.release.tag_name }}
docker push ghcr.io/${{ steps.lowercaserepo.outputs.REPO_LC }}:${{ github.event.release.tag_name }}