name: Publish Docker Image # Only a release built through "Releases -> New Release" starts a build. A tag # pushed with plain git does not publish a release and is therefore ignored. on: release: types: - published env: # Gitea container registry. Set a different host in # "Settings -> Actions -> Variables" if the instance ever moves. REGISTRY: git.srv.kingeldarion.de OWNER: ${{ github.repository_owner }} IMAGE: ac-web jobs: docker: runs-on: ubuntu-latest # This base image makes Docker-in-Docker with Gitea's act-runner painless. container: image: catthehacker/ubuntu:act-latest steps: - name: Checkout uses: https://github.com/actions/checkout@v4 - name: Set up QEMU uses: https://github.com/docker/setup-qemu-action@v3 - name: Set up Buildx uses: https://github.com/docker/setup-buildx-action@v3 - name: Login to Gitea Container Registry uses: https://github.com/docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.repository_owner }} # A personal access token, created in the repo settings as BUILDTOKEN. password: ${{ secrets.BUILDTOKEN }} - name: Docker meta (tags & labels) id: meta uses: https://github.com/docker/metadata-action@v5 with: images: | ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE }} # Only releases end up here, so every build is the newest one and # branch tags can never occur. Move `latest` behind a condition on # `github.event.release.prerelease` if pre-releases are used. tags: | type=raw,value=latest type=ref,event=tag type=sha,format=short # The dockerfile compiles the web bundle itself, so the context is the # flutter project and nothing has to be built before this step. - name: Build & Push the website image uses: https://github.com/docker/build-push-action@v5 with: context: ./ac_web file: ./ac_web/Dockerfile push: true platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}