-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 1.58 KB
/
docker.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: Docker image
on:
workflow_dispatch:
permissions:
packages: write
env:
IMAGE_NAME: pufferpanel
IMAGE_REGISTRY: ghcr.io/oskardotglobal
REGISTRY_USER: oskardotglobal
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
platform:
- "amd64"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: ${{ matrix.platform }}
if: ${{ matrix.platform != 'amd64' }}
- name: Get dates
id: date
run: |
echo "build=$(date --rfc-3339 ns)" >> $GITHUB_OUTPUT
echo "tag=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: Build image
id: base
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ steps.date.outputs.tag }} latest
context: .
platforms: linux/${{ matrix.platform }}
containerfiles: |
Dockerfile
build-args: |
ARCH=${{ matrix.platform }}
BUILD_DATE=${{ steps.date.outputs.build }}
VCS_REF=${{ github.sha }}
- name: Push image to GHCR
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.base.outputs.image }}
tags: ${{ steps.base.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}