I have a Github organization and try to migrate container registry from docker hub
to GitHub Packages
. By using Github Workflows, here's the yaml I used to push docker to GitHub Packages
:
name: ghcr_test
on:
push:
branches:
- dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to GitHub Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
GitHub recommends using GITHUB_TOKEN in action workflows, I'm already double check it has read and write permission in my organization settings, but they gave me this error
Error: buildx failed with: error: denied: permission_denied: write_package
Any help?
GITHUB_TOKEN
? You can do this usingpermissions:
yaml key Also read this about packages and workflows – Underlayer