|
| 1 | +name: Docker Image |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + - release/** |
| 9 | +jobs: |
| 10 | + build-docker-image: |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + include: |
| 15 | + - os: ubuntu-24.04 |
| 16 | + platform: amd64 |
| 17 | + - os: ubuntu-24.04-arm |
| 18 | + platform: arm64 |
| 19 | + name: build-docker-image-${{ matrix.platform }} |
| 20 | + permissions: |
| 21 | + contents: read |
| 22 | + packages: write |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 25 | + |
| 26 | + - name: Build and push chartcuterie image |
| 27 | + uses: getsentry/action-build-and-push-images@b172ab61a5f7eabd58bd42ce231b517e79947c01 |
| 28 | + with: |
| 29 | + image_name: 'chartcuterie' |
| 30 | + platforms: linux/${{ matrix.platform }} |
| 31 | + dockerfile_path: './Dockerfile' |
| 32 | + ghcr: ${{ github.event_name != 'pull_request' }} |
| 33 | + tag_suffix: -${{ matrix.platform }} |
| 34 | + publish_on_pr: ${{ github.event.pull_request.author_association == 'OWNER' || github.event.pull_request.author_association == 'MEMBER' }} |
| 35 | + google_ar: false |
| 36 | + tag_nightly: false |
| 37 | + tag_latest: false |
| 38 | + |
| 39 | + assemble-chartcuterie-image: |
| 40 | + runs-on: ubuntu-latest |
| 41 | + needs: [build-docker-image] |
| 42 | + if: ${{ (github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request' }} |
| 43 | + permissions: |
| 44 | + contents: read |
| 45 | + packages: write |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 48 | + |
| 49 | + - run: docker login --username '${{ github.actor }}' --password-stdin ghcr.io <<< "$GHCR_TOKEN" |
| 50 | + env: |
| 51 | + GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + |
| 53 | + - name: Set up Docker Buildx |
| 54 | + uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 |
| 55 | + |
| 56 | + - name: Create multiplatform manifests |
| 57 | + run: | |
| 58 | + docker buildx imagetools create \ |
| 59 | + --tag ghcr.io/getsentry/chartcuterie:${{ github.event.pull_request.head.sha || github.sha }} \ |
| 60 | + --tag ghcr.io/getsentry/chartcuterie:nightly \ |
| 61 | + ghcr.io/getsentry/chartcuterie:${{ github.event.pull_request.head.sha || github.sha }}-amd64 \ |
| 62 | + ghcr.io/getsentry/chartcuterie:${{ github.event.pull_request.head.sha || github.sha }}-arm64 |
0 commit comments