fix: Add Docker login and permissions to CI workflow
This commit fixes the Docker image push failure in the CI workflow by adding the necessary Docker login step and ensuring the correct permissions are set for the GITHUB_TOKEN. - Added a Docker login step using `docker/login-action@v3` to the `Build Docker Image` job in `.github/workflows/ci.yaml`. This authenticates to GHCR before attempting to push images. - Added a `permissions` block to the `Build Docker Image` job, granting `packages: write` scope to the `GITHUB_TOKEN`. This is required to allow pushing packages to the GitHub Container Registry.pull/13/head
parent
bb9d61ae73
commit
6c0c29f53e
|
|
@ -27,6 +27,9 @@ jobs:
|
|||
build:
|
||||
name: Build Docker Image
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read # Needed to checkout the repository
|
||||
packages: write # Needed to push Docker images to GHCR
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
|
@ -50,6 +53,13 @@ jobs:
|
|||
# Tag with 'latest' if on the main branch (though this workflow only runs on PRs to main)
|
||||
type=ref,event=branch,pattern=main,value=latest
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
|
|
|
|||
Loading…
Reference in New Issue