From cd63a825ee0424bc888818f3e44849c9828755ba Mon Sep 17 00:00:00 2001 From: Mroik Date: Thu, 23 Apr 2026 04:22:34 +0200 Subject: Add CI for image --- .github/workflows/ghcr.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ghcr.yml diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml new file mode 100644 index 0000000..6ab24a2 --- /dev/null +++ b/.github/workflows/ghcr.yml @@ -0,0 +1,50 @@ +name: Create and publish a Docker image + +on: + release: + types: [released] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write + # + steps: + - name: Checkout repository + uses: actions/checkout@v5 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v3 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true diff --git a/Cargo.lock b/Cargo.lock index 3bb6b19..315ddc6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1873,7 +1873,7 @@ dependencies = [ [[package]] name = "orange-whale" -version = "0.1.2" +version = "0.1.3" dependencies = [ "anyhow", "clokwerk", diff --git a/Cargo.toml b/Cargo.toml index 54a549b..0a062c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "orange-whale" -version = "0.1.2" +version = "0.1.3" edition = "2024" [dependencies] -- cgit v1.3