-
Notifications
You must be signed in to change notification settings - Fork 10
85 lines (69 loc) · 2.07 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
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
- name: Create release
run: mix release
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
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: Copy release
run: |
id=$(docker create ex_nvr:${{ github.ref_name }}-arm64)
docker cp $id:/app/build-assets/. _build/prod/
docker rm -v $id
- name: Create GH release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref_name }}
generate_release_notes: true
files: |
_build/prod/*.deb
_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 apps/ex_nvr_web/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