Merge pull request #99 from JobDoesburg/dependabot/pip/dev-tools-ed23… #85
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Builds and pushes the production Docker image. The "Deploy" workflow | |
| # triggers on successful completion of this workflow (workflow_run). | |
| name: Build and push | |
| on: | |
| push: | |
| branches: ["master"] | |
| release: | |
| types: [published] | |
| concurrency: | |
| group: build-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-and-push-image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ghcr.io/${{ github.repository_owner }}/landolfio | |
| # Tag strategy: | |
| # master push → sha-<sha>, latest | |
| # release vX.Y.Z → sha-<sha>, X.Y.Z, X.Y, X (and "latest" only on non-prerelease) | |
| tags: | | |
| type=sha,format=long | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.release.prerelease == false }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |