no post signin anymore #6
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
name: Docker Image CI | |
env: | |
BUILD_PLATFORM: | | |
linux/arm/v6 | |
linux/arm/v7 | |
linux/arm64 | |
linux/amd64 | |
DOCKER_BUILDKIT: 1 | |
IMAGE_NAME: image | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Tag Image | |
id: tag_image | |
run: | | |
DOCKER_REPOSITORY=ghcr.io/${{ github.repository }}/$IMAGE_NAME | |
DOCKER_REPOSITORY=$(echo $DOCKER_REPOSITORY | tr '[A-Z]' '[a-z]') | |
DOCKER_TAG=latest | |
echo ::set-output name=docker_repository::${DOCKER_REPOSITORY} | |
echo ::set-output name=docker_tag::${DOCKER_TAG} | |
- name: Log into registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build Image | |
uses: docker/build-push-action@v3 | |
with: | |
build-args: REPO=${{ github.repository }} | |
context: . | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
file: Dockerfile | |
platforms: ${{ env.BUILD_PLATFORM }} | |
push: true | |
tags: | | |
${{ steps.tag_image.outputs.docker_repository }}:${{ steps.tag_image.outputs.docker_tag }} | |
${{ steps.tag_image.outputs.docker_repository }}:${{ github.sha }} | |
target: runtime-image |