forked from TrueCloudLab/distribution
feat: push distribution images to GHCR (#4130)
This commit is contained in:
commit
ecb475a232
1 changed files with 14 additions and 1 deletions
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
|
@ -15,6 +15,7 @@ on:
|
|||
|
||||
env:
|
||||
DOCKERHUB_SLUG: distribution/distribution
|
||||
GHCR_SLUG: ghcr.io/${{ github.repository }}
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
@ -53,6 +54,7 @@ jobs:
|
|||
build:
|
||||
permissions:
|
||||
contents: write # to create GitHub release (softprops/action-gh-release)
|
||||
packages: write # so we can push the image to GHCR
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
|
@ -70,6 +72,7 @@ jobs:
|
|||
with:
|
||||
images: |
|
||||
${{ env.DOCKERHUB_SLUG }}
|
||||
${{ env.GHCR_SLUG }}
|
||||
### versioning strategy
|
||||
### push semver tag v3.2.1 on main (default branch)
|
||||
# distribution/distribution:3.2.1
|
||||
|
@ -88,7 +91,7 @@ jobs:
|
|||
type=edge
|
||||
labels: |
|
||||
org.opencontainers.image.title=Distribution
|
||||
org.opencontainers.image.description=The toolkit to pack, ship, store, and deliver container content
|
||||
org.opencontainers.image.description=The toolkit to pack, ship, store, and distribute container content
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
@ -99,6 +102,16 @@ jobs:
|
|||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
-
|
||||
name: Log in to GitHub Container registry
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
-
|
||||
name: Build artifacts
|
||||
uses: docker/bake-action@v2
|
||||
|
|
Loading…
Reference in a new issue