This repository has been archived by the owner on May 26, 2023. It is now read-only.
91 lines (73 loc) · 2.08 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
build-docker-image:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Branch name
id: branch_name
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/v}
- name: Setup Path
run: |
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
echo "PIPX_BIN_DIR=$HOME/.local/bin" >> $GITHUB_ENV
- name: Install Base Dependencies
run: |
sudo apt-get update
sudo apt-get install python3-venv pipx
pipx install poetry
- name: Build Application
run: |
poetry build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: scmmmh
password: ${{ secrets.DOCKERACCESSTOKEN }}
- name: Build and Push Image
uses: docker/build-push-action@v4
with:
context: .
file: docker/production/Dockerfile
push: true
tags: scmmmh/senior-common-room:${{ steps.branch_name.outputs.SOURCE_TAG }}
build-frontend:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Dependencies
run: |
cd src/frontend
npm install
- name: Build Frontend
run: |
cd src/frontend
./node_modules/.bin/rollup -c
- name: Create Packages
run: |
cp -r src/frontend/public ./frontend
tar -jcvf scr_frontend.tar.bz2 ./frontend
zip -r scr_frontend.zip ./frontend
- name: Add Packages to Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
scr_frontend.tar.bz2
scr_frontend.zip