-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (50 loc) · 1.71 KB
/
ci-dev.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
name: ci
on:
push:
branches-ignore:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Extract branch variable
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Extract revision variable
run: echo "GIT_REVISION=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR as ${{ github.actor }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Required to mount the Github Workspace to a volume
- name: Checkout
uses: actions/checkout@v4
- name: Build static content
uses: addnab/docker-run-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
image: ghcr.io/wirenboard/website-base-image:initial
options: -v ${{ github.workspace }}:/var/www
run: |
cd /var/www
echo "${{ env.BRANCH }}@${{ env.GIT_REVISION }}" > public/version.txt
echo "Version set to $(cat public/version.txt)"
pnpm install
pnpm run build
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,arm64
tags: |
ghcr.io/wirenboard/website:${{ env.BRANCH }}-${{ env.GIT_REVISION }}
ghcr.io/wirenboard/website:${{ env.BRANCH }}
ghcr.io/wirenboard/website:testing