This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
build-image #11
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: Check files | |
run: ls -la | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: mcmattia | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: mcmattia | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
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: ghcr.io/mcmattia/stm32cubeide-docker | |
subject-digest: ${{ steps.push.outputs.digest }} | |
push-to-registry: true |