mirror of
https://github.com/phusion/baseimage-docker.git
synced 2026-03-26 04:18:46 +00:00
CI: Github Container Registry too
This commit is contained in:
committed by
GitHub
parent
227465e2d6
commit
157deafb0e
19
.github/workflows/main.yml
vendored
19
.github/workflows/main.yml
vendored
@@ -19,21 +19,32 @@ jobs:
|
||||
id: prep
|
||||
run: |
|
||||
DOCKER_IMAGE=phusion/baseimage
|
||||
VERSION=focal-test
|
||||
GIT_BRANCH=${GITHUB_REF##*/}
|
||||
TAGS="${DOCKER_IMAGE}:${GIT_BRANCH}"
|
||||
TAGS="${DOCKER_IMAGE}:${GIT_BRANCH}, ghcr.io/${{ github.repository_owner }}/baseimage:${GIT_BRANCH}"
|
||||
|
||||
# Set output parameters.
|
||||
|
||||
if [ "${{github.event_name}}" == "pull_request" ]; then
|
||||
echo ::set-output name=push::false
|
||||
else
|
||||
echo ::set-output name=tags::${TAGS}
|
||||
echo ::set-output name=branch::${GIT_BRANCH}
|
||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||
fi
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
platforms: amd64,arm64
|
||||
|
||||
- name: Login to GHCR (Github Container Registry)
|
||||
uses: docker/login-action@v1
|
||||
if: github.event_name != 'pull_request'
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
@@ -42,6 +53,7 @@ jobs:
|
||||
version: latest
|
||||
driver-opts: image=moby/buildkit:latest
|
||||
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v1
|
||||
@@ -52,9 +64,8 @@ jobs:
|
||||
- name: Build and Push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
build-args: VERSION=focal-1.0.0-test
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
context: image
|
||||
platforms: amd64,arm64
|
||||
push: true
|
||||
push: ${{ steps.prep.outputs.push }}
|
||||
tags: ${{ steps.prep.outputs.tags }}
|
||||
|
||||
Reference in New Issue
Block a user