-
Notifications
You must be signed in to change notification settings - Fork 4
92 lines (90 loc) · 2.63 KB
/
build.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
name: Website
on:
push:
branches:
- main
- development
paths:
- "Website/**"
pull_request:
branches:
- main
- development
paths:
- "Website/**"
workflow_dispatch:
workflow_call:
secrets:
DEPLOY_HOST:
required: true
DEPLOY_USERNAME:
required: true
DEPLOY_KEY:
required: true
DEPLOY_FOLDER:
required: true
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt-get install -y musl-dev gcc-aarch64-linux-gnu libssl-dev pkg-config libudev-dev
- name: Add Toolchain ARM64
run: rustup target add aarch64-unknown-linux-gnu
- name: Build for ARM64
working-directory: ./Website
run: |
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc
cargo build --verbose --target aarch64-unknown-linux-gnu --release
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Install PNPM packages
working-directory: ./Website
run: pnpm install
- name: Run Tailwind
working-directory: ./Website
run: pnpm run tailwind
- name: Prepare Upload
working-directory: ./Website
run: |
cp target/aarch64-unknown-linux-gnu/release/FicsIt-Networks-Repository-Website .
chmod 770 ./FicsIt-Networks-Repository-Website
- name: Upload Website
uses: actions/upload-artifact@v4
with:
name: Website
path: |
./Website/FicsIt-Networks-Repository-Website
./Website/static/
deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Download Website
uses: actions/download-artifact@v4
with:
name: Website
path: ./Website
- name: Copy Website artifact to server
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
source: "./Website/*"
target: ${{ secrets.DEPLOY_FOLDER }}
- name: Docker Compose
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
cd ${{ secrets.DEPLOY_FOLDER }}
chmod 770 ./Website/FicsIt-Networks-Repository-Website
podman-compose up --build --force-recreate