diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d728b0..2222534 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,10 @@ on: push: branches: [main] +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + jobs: release: name: Release @@ -29,20 +33,23 @@ jobs: name: GitHub Container Registry runs-on: ubuntu-latest needs: release + permissions: + contents: read + packages: write steps: - uses: actions/checkout@v4 - name: Login to GitHub Container Registry - run: echo ${{ secrets.GHCR_ACCESS_TOKEN }} | docker login ghcr.io -u luketainton --password-stdin + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin - name: Build image for GitHub Package Registry run: | docker build . --file Dockerfile \ --build-arg "version=${{ needs.release.outputs.new_tag }}" \ - --tag ghcr.io/luketainton/roboluke-tasks:${{ needs.release.outputs.new_tag }} \ - --tag ghcr.io/luketainton/roboluke-tasks:latest + --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.release.outputs.new_tag }} \ + --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - name: Push image to GitHub Package Registry run: | - docker push ghcr.io/luketainton/roboluke-tasks:latest - docker push ghcr.io/luketainton/roboluke-tasks:${{ needs.release.outputs.new_tag }} + docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.release.outputs.new_tag }} deploy: name: Update Portainer Deployment