edge-build #13
This file contains 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: "CD: Edge Build" | |
on: | |
repository_dispatch: | |
types: [edge-build] | |
env: | |
REGISTRY: images.opencadc.org | |
IMAGE: platform/skaha | |
TAG: edge | |
jobs: | |
edge-build: | |
if: github.repository == 'opencadc/science-platform' | |
runs-on: ubuntu-latest | |
permissions: | |
attestations: write | |
id-token: write | |
steps: | |
- | |
name: Client Payload | |
id: client-payload | |
run: | | |
echo "Client Payload: ${{ toJson(github.event.client_payload) }}" | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Setup Docker Buildx | |
uses: docker/[email protected] | |
with: | |
install: true | |
- | |
name: Perform Container Registry Login | |
uses: docker/[email protected] | |
with: | |
registry: images.opencadc.org | |
username: ${{ secrets.SKAHA_REGISTRY_USERNAME }} | |
password: ${{ secrets.SKAHA_REGISTRY_TOKEN }} | |
- | |
name: Build and Push Docker Image | |
id: build | |
uses: docker/[email protected] | |
with: | |
context: skaha/ | |
target: production | |
file: skaha/Dockerfile | |
platforms: linux/amd64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
provenance: mode=max | |
sbom: true | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.TAG }} | |
labels: | | |
org.opencontainers.image.title=Science Platform | |
org.opencontainers.image.licenses=AGPL-3.0 | |
org.opencontainers.image.url=https://github.com/opencadc/science-platform | |
- | |
# See https://github.com/marketplace/actions/attest-build-provenance#container-image | |
# for more information on the attest-build-provenance action | |
name: Attest Container Image | |
id: attest | |
uses: actions/[email protected] | |
with: | |
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE }} | |
subject-digest: ${{ steps.build.outputs.digest }} | |
# push-to-registry: true | |
show-summary: true | |
- | |
name: Install Cosign | |
id: install-cosign | |
uses: sigstore/[email protected] | |
with: | |
cosign-release: 'v2.4.1' | |
- | |
name: Cosign Container Image | |
id: cosign | |
run: | | |
cosign version | |
cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.TAG }} --upload |