Skip to content

Commit

Permalink
added docker release wf (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
WouterVisscher authored Feb 6, 2024
1 parent ee7a238 commit dc4b906
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 }}

0 comments on commit dc4b906

Please sign in to comment.