Merge pull request #584 from sosedoff/github-container-registry

Configure github container registry access for new releases
This commit is contained in:
Dan Sosedoff 2022-11-15 17:54:11 -06:00 committed by GitHub
commit e5281751c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,8 @@ on:
env:
GO_VERSION: 1.18
CGO_ENABLED: 0
IMAGE_REPOSITORY: sosedoff/pgweb
DOCKER_REPOSITORY: sosedoff/pgweb
GHCR_REPOSITORY: sosedoff/pgweb
jobs:
docker-release:
@ -33,18 +34,27 @@ jobs:
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/v}
- name: Login to Docker
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Build and push docker images
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
${{ env.IMAGE_REPOSITORY }}:${{ steps.refs.outputs.SOURCE_TAG }}
${{ env.IMAGE_REPOSITORY }}:latest
${{ env.DOCKER_REPOSITORY }}:${{ steps.refs.outputs.SOURCE_TAG }}
${{ env.DOCKER_REPOSITORY }}:latest
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ steps.refs.outputs.SOURCE_TAG }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:latest
platforms: linux/amd64,linux/arm64,linux/arm/v5,linux/arm/v7