Update build/deploy

This commit is contained in:
Luke Tainton 2024-06-04 22:30:11 +01:00
parent 1f4b17a0cd
commit a11fbe2109
No known key found for this signature in database

View File

@ -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