1
0
mirror of https://github.com/phusion/baseimage-docker.git synced 2026-03-26 12:29:07 +00:00

CI: Github Container Registry too

This commit is contained in:
Skyler Mäntysaari
2021-09-02 21:40:33 +03:00
committed by GitHub
parent 227465e2d6
commit 157deafb0e

View File

@@ -19,21 +19,32 @@ jobs:
id: prep id: prep
run: | run: |
DOCKER_IMAGE=phusion/baseimage DOCKER_IMAGE=phusion/baseimage
VERSION=focal-test
GIT_BRANCH=${GITHUB_REF##*/} 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. # 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=tags::${TAGS}
echo ::set-output name=branch::${GIT_BRANCH} echo ::set-output name=branch::${GIT_BRANCH}
echo ::set-output name=docker_image::${DOCKER_IMAGE} echo ::set-output name=docker_image::${DOCKER_IMAGE}
fi
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
with: with:
platforms: amd64,arm64 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 - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
@@ -42,6 +53,7 @@ jobs:
version: latest version: latest
driver-opts: image=moby/buildkit:latest driver-opts: image=moby/buildkit:latest
- name: Login to Docker Hub - name: Login to Docker Hub
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
uses: docker/login-action@v1 uses: docker/login-action@v1
@@ -52,9 +64,8 @@ jobs:
- name: Build and Push - name: Build and Push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
build-args: VERSION=focal-1.0.0-test
builder: ${{ steps.buildx.outputs.name }} builder: ${{ steps.buildx.outputs.name }}
context: image context: image
platforms: amd64,arm64 platforms: amd64,arm64
push: true push: ${{ steps.prep.outputs.push }}
tags: ${{ steps.prep.outputs.tags }} tags: ${{ steps.prep.outputs.tags }}