-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (48 loc) · 1.56 KB
/
build-container.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
name: build-docker-images
on:
push:
branches:
- release*
paths:
- "lib/**/**"
- "src/**"
- ".github/workflows/**"
permissions:
contents: read
packages: write
jobs:
docker-builds:
strategy:
matrix:
app:
- auth
- console
- devdoc
- website
runs-on: ubuntu-latest
name: Deploy to Docker Image
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Install UPX
run: |
curl -L0 https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-amd64_linux.tar.xz > upx.tar.xz
tar -xf upx.tar.xz
sudo mv upx-4.2.1-amd64_linux/upx /usr/local/bin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Push Image
if: startsWith(github.ref, 'refs/heads/release')
run: |
branch_name=${GITHUB_REF#refs/heads/}
version_string="v${branch_name#release-}-nightly"
docker build --build-arg APP=${{matrix.app}} . -t ghcr.io/kloudlite/platform/web/${{matrix.app}}:$version_string --push
docker build --build-arg APP=${{matrix.app}} . -t ghcr.io/kloudlite/platform/web/${{matrix.app}}:commit-${GITHUB_SHA} --push