Garnet Docker images for Linux #1216
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
| name: Garnet Docker images for Linux | |
| on: | |
| workflow_dispatch: # allow manual run | |
| workflow_run: | |
| workflows: ['Garnet .NET CI'] | |
| types: [completed] | |
| branches: [main] | |
| push: | |
| tags: 'v*' | |
| jobs: | |
| docker: | |
| strategy: | |
| matrix: | |
| include: | |
| - dockerfile: Dockerfile | |
| image: ghcr.io/${{ github.repository }} | |
| os: ubuntu-latest | |
| - dockerfile: Dockerfile.alpine | |
| image: ghcr.io/${{ github.repository }}-alpine | |
| os: ubuntu-latest | |
| - dockerfile: Dockerfile.ubuntu | |
| image: ghcr.io/${{ github.repository }}-noble | |
| os: ubuntu-latest | |
| - dockerfile: Dockerfile.chiseled | |
| image: ghcr.io/${{ github.repository }}-noble-chiseled | |
| os: ubuntu-latest | |
| - dockerfile: Dockerfile.azurelinux | |
| image: ghcr.io/${{ github.repository }}-azurelinux3.0 | |
| os: ubuntu-latest | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name != 'workflow_run' }} | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v6 | |
| - | |
| name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6 for security reasons we have pinned the tag (commit SHA) for 3rd party | |
| with: | |
| images: ${{ matrix.image }} | |
| tags: | | |
| # generate Docker tags based on the following events/attributes | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha | |
| # set latest tag for default branch | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - | |
| name: Set up QEMU | |
| uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4 for security reasons we have pinned the tag (commit SHA) for 3rd party | |
| - | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4 for security reasons we have pinned the tag (commit SHA) for 3rd party | |
| - | |
| name: Login to GitHub Container Registry | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4 for security reasons we have pinned the tag (commit SHA) for 3rd party | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - | |
| name: Build and push | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7 for security reasons we have pinned the tag (commit SHA) for 3rd party | |
| with: | |
| file: ${{ matrix.dockerfile }} | |
| provenance: false | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ (github.ref_name == 'main' || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v'))) && github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |