-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: using GHCR as the new registry (#4)
This patch implements the use of ghcr.io as the new container registry for the project. Signed-off-by: Jonathan Gonzalez V <[email protected]> Co-authored-by: Jonathan Gonzalez V <[email protected]>
- Loading branch information
Showing
2 changed files
with
32 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,34 +5,55 @@ on: | |
branches: [ main ] | ||
tags: [ '*' ] | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }}, | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
contents: read | ||
packages: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout source code | ||
uses: actions/[email protected] | ||
|
||
- name: Get the reference | ||
id: get_version | ||
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) | ||
|
||
- name: Image metadata | ||
id: metadata | ||
uses: docker/[email protected] | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version} | ||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
with: | ||
image: tonistiigi/binfmt:qemu-v6.1.0 | ||
image: tonistiigi/binfmt:qemu-v6.2.0 | ||
platforms: "linux/amd64,linux/arm64,linux/ppc64le,linux/s390x" | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
uses: docker/[email protected] | ||
|
||
- name: Login to registry | ||
uses: docker/login-action@v1 | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v3.0.0 | ||
uses: docker/build-push-action@v3.1.0 | ||
with: | ||
context: . | ||
platforms: "linux/amd64,linux/arm64,linux/ppc64le,linux/s390x" | ||
tags: ${{ steps.get_version.outputs.VERSION }} | ||
push: true | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters