-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (43 loc) · 1.39 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
name: C++ CI Push Main
on:
release:
types: [ published ]
branches: [ main ]
push:
branches: [main]
pull_request:
types: [ closed ]
branches:
- main
jobs:
build-and-publish-release:
runs-on: [self-hosted, Linux, X64, ubuntu-latest-lts]
if: ${{ github.event_name == 'push' && github.event.pull_request == null }}
steps:
- uses: actions/checkout@v4
- name: Set PATH for pipx binaries
run: echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
- name: Load NVM and Node
run: |
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm use node
- name: Source environment variables
run: |
sudo cp /srv/portfolio/.env ./
sed -i 's/^PORT=.*/PORT=3300/' .env
source .env
- name: Install pnpm
run: sudo npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Publish Executable
run: |
sudo systemctl stop portfolio
sudo find /srv/portfolio/ -mindepth 1 ! -name 'media' ! -name '.env' -exec rm -rf {} +
sudo rsync -av --exclude 'media' --exclude '.env' /home/gh-runner/actions-runner/_work/portfolio/portfolio/ /srv/portfolio/
cd /srv/portfolio
pnpm install
sudo systemctl start portfolio