forked from ImSwitch/ImSwitch
-
Notifications
You must be signed in to change notification settings - Fork 15
61 lines (50 loc) · 1.63 KB
/
imswitch-docker-multiarch-noqt.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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 }}