Skip to content

Commit

Permalink
Move to ghcr.io (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
fhopfensperger committed Apr 6, 2023
1 parent 9922087 commit 5de051e
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ^1.16
id: go
Expand Down Expand Up @@ -51,24 +51,32 @@ jobs:
- name: Set up QEMU
if: startsWith(github.ref, 'refs/tags/')
uses: docker/setup-qemu-action@v1

uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: startsWith(github.ref, 'refs/tags/')
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to GHCR
if: startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push container image
- name: Build and push Docker image
if: startsWith(github.ref, 'refs/tags/')
env:
QUAY_USER: ${{ secrets.QUAY_USER }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
run: |
docker login -u=$QUAY_USER -p=$QUAY_TOKEN quay.io
docker buildx build \
--platform linux/arm/v7,linux/amd64,linux/arm64 \
--tag quay.io/fhopfensperger/simple-go-app:latest \
--tag quay.io/fhopfensperger/simple-go-app:$RELEASE_VERSION_WITHOUT_V \
-f Dockerfile \
--build-arg BUILD_VERSION=$RELEASE_VERSION_WITHOUT_V \
--push .
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: |
BUILD_VERSION=${{ env.RELEASE_VERSION_WITHOUT_V }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION_WITHOUT_V }}

0 comments on commit 5de051e

Please sign in to comment.