Skip to content

Commit

Permalink
fix: only add attestation to nightly docker
Browse files Browse the repository at this point in the history
  • Loading branch information
SMillerDev authored Aug 16, 2024
1 parent 266a1bc commit 96afc21
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,6 @@ jobs:
docker tag brew "ghcr.io/homebrew/ubuntu${{matrix.version}}:latest"
docker push "ghcr.io/homebrew/ubuntu${{matrix.version}}:latest"
- name: Generate image digest
if: startsWith(github.ref, 'refs/tags/')
id: digest
run: echo "digest=$(docker image inspect --format='{{.Digest}}' brew:${brew_version})" >> "$GITHUB_OUTPUT"

- name: Generate build provenance
uses: actions/attest-build-provenance@5e9cb68e95676991667494a6a4e59b8a2f13e1d0 # v1.3.3
if: startsWith(github.ref, 'refs/tags/')
id: attest
with:
subject-name: ghcr.io/homebrew/ubuntu${{matrix.version}}
subject-digest: ${{ steps.digest.outputs.digest }}
push-to-registry: ${{ startsWith(github.ref, 'refs/tags/') }}

- name: Deploy the tagged Docker image to Docker Hub
if: startsWith(github.ref, 'refs/tags/')
run: |
Expand Down
28 changes: 22 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,30 @@ jobs:
- name: Deploy the Docker image to GitHub Packages and Docker Hub
if: github.ref == 'refs/heads/master'
run: |
echo ${{secrets.HOMEBREW_BREW_GITHUB_PACKAGES_TOKEN}} |
echo ${{ secrets.HOMEBREW_BREW_GITHUB_PACKAGES_TOKEN }} |
docker login ghcr.io -u BrewTestBot --password-stdin
docker tag brew "ghcr.io/homebrew/ubuntu22.04:master"
docker push "ghcr.io/homebrew/ubuntu22.04:master"
echo ${{secrets.HOMEBREW_BREW_DOCKER_TOKEN}} |
docker tag brew "ghcr.io/homebrew/ubuntu22.04:${{ github.ref_name }}"
docker push "ghcr.io/homebrew/ubuntu22.04:${{ github.ref_name }}"
echo ${{ secrets.HOMEBREW_BREW_DOCKER_TOKEN }} |
docker login -u brewtestbot --password-stdin
docker tag brew "homebrew/ubuntu22.04:master"
docker push "homebrew/ubuntu22.04:master"
docker tag brew "homebrew/ubuntu22.04:${{ github.ref_name }}"
docker push "homebrew/ubuntu22.04:${{ github.ref_name }}"
- name: Generate image digest
if: github.ref == 'refs/heads/master'
id: digest
run: |
digest="$(docker image inspect --format='{{.Digest}}' brew)"
echo "digest=$digest" >> "$GITHUB_OUTPUT"
- name: Generate build provenance
uses: actions/attest-build-provenance@5e9cb68e95676991667494a6a4e59b8a2f13e1d0 # v1.3.3
if: github.ref == 'refs/heads/master'
id: attest
with:
push-to-registry: true
subject-digest: ${{ steps.digest.outputs.digest }}
subject-name: ghcr.io/homebrew/ubuntu22.04:${{ github.ref_name }}

update-test:
name: ${{ matrix.name }}
Expand Down

0 comments on commit 96afc21

Please sign in to comment.