Merge branch 'master' of https://github.com/openUC2/ImSwitch #87
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: imswitch-docker-multiarch-noqt | |
on: | |
workflow_dispatch: | |
push: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: openuc2/imswitch-noqt | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Log in to GitHub container registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Set architecture to lowercase | |
run: echo "ARCH=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- name: Print Dockerfile | |
run: cat dockerfile | |
- name: Build and push container image to registry | |
uses: docker/build-push-action@v2 | |
with: | |
context: docker | |
file: dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=registry,ref=ghcr.io/${{ env.IMAGE_NAME }}-${{ env.ARCH }}:latest | |
cache-to: type=inline | |
tags: ghcr.io/${{ env.IMAGE_NAME }}-${{ env.ARCH }}:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
BUILD_DATE=${{ github.run_id }} |