Initial commit: ApstraHub container test repository #1
Workflow file for this run
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
| # Copyright (c) Juniper Networks, Inc., 2025-2026. | |
| # All rights reserved. | |
| # SPDX-License-Identifier: MIT | |
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-sign-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write # Required for keyless Cosign signing via Sigstore/OIDC | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Install Cosign | |
| uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 | |
| - name: Extract metadata for Docker | |
| id: meta | |
| uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=ref,event=tag | |
| - name: Build and Push Container | |
| id: build | |
| uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| platforms: linux/amd64,linux/arm64 | |
| - name: Sign Container with Cosign (Keyless via Sigstore/OIDC) | |
| env: | |
| DIGEST: ${{ steps.build.outputs.digest }} | |
| run: | | |
| IMAGE="ghcr.io/${{ github.repository }}@${DIGEST}" | |
| echo "Signing image: $IMAGE" | |
| cosign sign --yes "$IMAGE" | |
| - name: Create container-url.txt | |
| env: | |
| DIGEST: ${{ steps.build.outputs.digest }} | |
| run: | | |
| # Include digest for immutable reference | |
| echo "ghcr.io/${{ github.repository }}@${DIGEST}" > container-url.txt | |
| echo "Container URL: $(cat container-url.txt)" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1 | |
| with: | |
| files: | | |
| container-url.txt | |
| README.md | |
| generate_release_notes: true |