Skip to content

Commit

Permalink
Use GHCR to publish images
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasmaroy committed Feb 1, 2025
1 parent f56210b commit db42843
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
runs-on: ubuntu-latest
permissions:
security-events: write # permit upload of sarif output from the workflow
contents: read
packages: write
id-token: write
env:
GROCY_IMAGE_TAG: ${{ github.event.release.tag_name }}
steps:
Expand Down Expand Up @@ -54,33 +57,13 @@ jobs:
with:
image: ${{ steps.build-grocy-backend.outputs.image }}
tags: ${{ steps.build-grocy-backend.outputs.tags }}
registry: docker.io/grocy
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: redhat-actions/push-to-registry@v2.5
with:
image: ${{ steps.build-grocy-frontend.outputs.image }}
tags: ${{ steps.build-grocy-frontend.outputs.tags }}
registry: docker.io/grocy
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Perform vulnerability scanning
## Note: please move this to *before* the container publish steps after confirming a way to use anchore/scan-action with locally-built OCI images
- id: scan-grocy-backend
uses: anchore/scan-action@v3
with:
image: docker.io/grocy/${{ steps.build-grocy-backend.outputs.image-with-tag }}
fail-build: false # TODO: remove this when scan-action steps are moved to before container publish
- uses: github/codeql-action/upload-sarif@v2
with:
category: scan-grocy-backend
sarif_file: ${{ steps.scan-grocy-backend.outputs.sarif }}
- id: scan-grocy-frontend
uses: anchore/scan-action@v3
with:
image: docker.io/grocy/${{ steps.build-grocy-frontend.outputs.image-with-tag }}
fail-build: false # TODO: remove this when scan-action steps are moved to before container publish
- uses: github/codeql-action/upload-sarif@v2
with:
category: scan-grocy-frontend
sarif_file: ${{ steps.scan-grocy-frontend.outputs.sarif }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit db42843

Please sign in to comment.