build-image #21
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: build-image | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "*" | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
attestations: write | |
jobs: | |
fetch-installer-and-build-docker-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v4 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Fetch installer | |
run: deno run --allow-net --allow-write fetchInstaller.ts | |
- name: Write installer sha256sum to job summary | |
run: | | |
echo "Installer sha256sum:" >> $GITHUB_STEP_SUMMARY | |
sha256sum en.st-stm32cubeide_1.16.0_21983_20240628_1741_amd64.deb_bundle.sh.zip >> $GITHUB_STEP_SUMMARY | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: mcmattia | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/mcmattia/stm32cubeide-docker | |
- name: Build and push | |
id: push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: mcmattia/stm32cubeide-docker:1.0 | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-name: docker.io/mcmattia/stm32cubeide-docker | |
subject-digest: ${{ steps.push.outputs.digest }} | |
push-to-registry: true | |
- name: Verify | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: gh attestation verify oci://docker.io/mcmattia/stm32cubeide-docker:1.0 -R mcmattia/stm32cubeide-docker |