name: Development image on: push: branches: [main] paths-ignore: - "docs/**" - "**.md" workflow_dispatch: env: REGISTRY: git.fristy.net jobs: development: name: Development image runs-on: ubuntu-latest timeout-minutes: 30 permissions: contents: read packages: write # Releases reach main as a merge commit of the chore(release) branch, so match the scope. if: "!contains(github.event.head_commit.message, '(release)')" steps: - uses: actions/checkout@v7 - name: Name this build id: build run: echo "version=0.0.0-dev.$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" - name: Log in to the registry run: | token="${{ secrets.REGISTRY_TOKEN }}" [ -n "$token" ] || token="${{ secrets.GITEA_TOKEN }}" echo "$token" | docker login "$REGISTRY" -u "${{ github.actor }}" --password-stdin - name: Build and push uses: docker/build-push-action@v7 with: context: . push: true platforms: linux/amd64 cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:buildcache cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:buildcache,mode=max build-args: | VERSION=${{ steps.build.outputs.version }} tags: ${{ env.REGISTRY }}/${{ github.repository }}:development