-
Notifications
You must be signed in to change notification settings - Fork 10
99 lines (81 loc) · 2.55 KB
/
release.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-20.04
env:
MIX_ENV: prod
GENERATE_DEB_PACKAGE: true
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1.16
with:
otp-version: 26.1
elixir-version: 1.15.7
- name: Install dependencies
run: sudo apt-get update && sudo apt-get -y install npm libsrtp2-dev libturbojpeg-dev
- name: Get deps
run: mix deps.get --only prod
working-directory: ./ui
- name: Create release
run: mix release
working-directory: ./ui
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build arm64 release
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/arm64/v8
file: .github/workflows/Dockerfile
load: true
tags: ex_nvr:${{ github.ref_name }}-arm64
build-args: |
ERL_FLAGS=+JPperf true
- name: Build armhf release
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/arm/v7
file: .github/workflows/Dockerfile-arm
load: true
tags: ex_nvr:${{ github.ref_name }}-armhf
- name: Copy release
run: |
arm64_id=$(docker create ex_nvr:${{ github.ref_name }}-arm64)
arm_id=$(docker create ex_nvr:${{ github.ref_name }}-armhf)
docker cp $arm64_id:/app/ui/build-assets/. ui/_build/prod/
docker cp $arm_id:/app/ui/build-assets/. ui/_build/prod/
docker rm -v $arm64_id $arm_id
- name: Create GH release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref_name }}
generate_release_notes: true
files: |
ui/_build/prod/*.deb
ui/_build/prod/*.tar.gz
publish-docs:
needs: [release]
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Copy Documentation
run: cp ui/priv/static/openapi.yaml docs/
- name: Deploy to GitHub Pages
run: |
git config user.name "GitHub Actions"
git config user.email "github-actions@github.com"
git checkout --orphan gh-pages
git add -A
git commit -m "Deploy documentation for tag ${{ github.ref_name }} to github pages"
git push origin gh-pages -f