-
Notifications
You must be signed in to change notification settings - Fork 2.3k
85 lines (72 loc) · 2.53 KB
/
build-containers.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
name: "Build Containers"
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
build-containers-common:
runs-on: ubuntu-latest
outputs:
containerver: ${{ steps.getcontainerver.outputs.containerver }}
steps:
- name: Get Container Version
id: getcontainerver
run: |
echo "containerver=$(date +'%s')" >> "$GITHUB_OUTPUT"
build-containers:
needs: build-containers-common
strategy:
matrix:
include:
- runnertags: ubuntu-latest
arch: amd64
- runnertags: [self-hosted, ARM64]
arch: arm64
runs-on: ${{ matrix.runnertags }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: docker build
run: ./var/docker/docker-build.sh
- name: Print post-build debug info
run: |
docker images
- name: docker tag
env:
CONTAINERVER: ${{ needs.build-containers-common.outputs.containerver }}
run: |
docker tag localhost/postiz ghcr.io/gitroomhq/postiz-app:${{ matrix.arch }}-${{ env.CONTAINERVER }}
docker push ghcr.io/gitroomhq/postiz-app:${{ matrix.arch }}-${{ env.CONTAINERVER }}
docker tag localhost/postiz-devcontainer ghcr.io/gitroomhq/postiz-devcontainer:${{ env.CONTAINERVER }}
docker push ghcr.io/gitroomhq/postiz-devcontainer:${{ env.CONTAINERVER }}
docker tag ghcr.io/gitroomhq/postiz-devcontainer:${{ env.CONTAINERVER }} ghcr.io/gitroomhq/postiz-devcontainer:latest
docker push ghcr.io/gitroomhq/postiz-devcontainer:latest
build-container-manifest:
needs: [build-containers, build-containers-common]
runs-on: ubuntu-latest
steps:
- name: Login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Create Docker Manifest
env:
CONTAINERVER: ${{ needs.build-containers-common.outputs.containerver }}
run: |
docker manifest create \
ghcr.io/gitroomhq/postiz-app:latest \
ghcr.io/gitroomhq/postiz-app:amd64-${{ env.CONTAINERVER }} \
ghcr.io/gitroomhq/postiz-app:arm64-${{ env.CONTAINERVER }}
docker manifest push ghcr.io/gitroomhq/postiz-app:latest