docs: update README with detailed image contents and structure #37
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: Build and Publish | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| artifact-metadata: write | |
| attestations: write | |
| contents: read | |
| packages: write | |
| id-token: write | |
| env: | |
| IMAGE_NAME: ghcr.io/getarcaneapp/tools | |
| PUBLISH_PLATFORMS: linux/amd64,linux/386,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x | |
| jobs: | |
| validate: | |
| if: ${{ github.repository_owner != 'getarcaneapp' && github.actor != | |
| 'getarcaneappbot' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build validation image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| load: true | |
| platforms: linux/amd64 | |
| tags: arcane-toolbox:ci | |
| - name: Validate runtime contract | |
| run: ./scripts/validate.sh arcane-toolbox:ci | |
| publish: | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| needs: validate | |
| runs-on: depot-ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Depot CLI | |
| uses: depot/setup-action@v1 | |
| - name: Install cosign | |
| uses: sigstore/cosign-installer@v4.1.1 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Derive image metadata | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha | |
| - name: Build and publish image | |
| id: build | |
| uses: depot/build-push-action@v1 | |
| with: | |
| project: np622krb2x | |
| context: . | |
| file: ./Dockerfile | |
| platforms: ${{ env.PUBLISH_PLATFORMS }} | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: Sign published image | |
| run: cosign sign --yes --key env://COSIGN_PRIVATE_KEY "${IMAGE_NAME}@${{ | |
| steps.build.outputs.digest }}" | |
| env: | |
| COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} | |
| COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | |
| - name: Generate image digest attestation | |
| uses: actions/attest@v4 | |
| with: | |
| subject-name: ${{ env.IMAGE_NAME }} | |
| subject-digest: ${{ steps.build.outputs.digest }} | |
| push-to-registry: true | |
| - name: Record published digest | |
| run: | | |
| { | |
| echo "Published image: ${{ env.IMAGE_NAME }}" | |
| echo "Published platforms: ${{ env.PUBLISH_PLATFORMS }}" | |
| echo "Published digest: ${{ steps.build.outputs.digest }}" | |
| echo "Published attestation: ${{ env.IMAGE_NAME }}@${{ steps.build.outputs.digest }}" | |
| } >> "$GITHUB_STEP_SUMMARY" |