Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
danschmidt5189 committed Dec 27, 2024
1 parent 5a1ced1 commit be6bc14
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
- push
- workflow_dispatch

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
setup:
runs-on: ubuntu-latest
Expand All @@ -25,12 +29,11 @@ jobs:

needs: setup

outputs:
imageid: ${{ steps.image }}

permissions:
packages: write
contents: read
packages: write
attestations: write
id-token: write

runs-on: ubuntu-latest

Expand All @@ -53,12 +56,18 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: meta
name: Construct image tags and labels
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/berkeleylibrary/geodata
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
edu.berkeley.lib.build-timestamp=${{ github.event.repository.updated_at }}
edu.berkeley.lib.build-url=${{ needs.setup.outputs.build_url }}
Expand All @@ -73,8 +82,8 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- id: image
name: Build the docker image
- id: push
name: Build and push docker image
uses: docker/build-push-action@v6
with:
context: .
Expand All @@ -88,3 +97,10 @@ jobs:
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit be6bc14

Please sign in to comment.