-
Notifications
You must be signed in to change notification settings - Fork 1
31 lines (31 loc) · 1.14 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
name: Release
on: # yamllint disable-line rule:truthy
release:
types: [published]
permissions:
packages: write
contents: write
jobs:
build-and-push-image:
runs-on: ubuntu-24.04
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 }}