-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (67 loc) · 2.24 KB
/
fe.yaml
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
name: ssg
on:
# schedule:
# - cron: "30 4 * * *"
workflow_dispatch:
env:
SSHSTATS_BACKEND: "https://monkfish-app-ss3gb.ondigitalocean.app"
SSHSTATS_NUXT_PUBLIC_BASE_URL: "http://localhost:65000"
jobs:
generate-website:
runs-on: ubuntu-22.04
services:
data-server:
image: nginx:1.27.1
ports:
- 65000:80
volumes:
- ${{github.workspace}}/nginx:/usr/share/nginx/html
steps:
- name: checkout frontend repo
uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: "22.6.0"
- name: unpack nodenames
run: |
SSHSTATS_NODENAMES=$(jq -r '.[]' fe/assets/nodenames.json | tr '\n' ' ')
echo "SSHSTATS_NODENAMES=$SSHSTATS_NODENAMES" >> "$GITHUB_ENV"
- name: download attempts data
run: |
for nodename in $SSHSTATS_NODENAMES; do
echo "Downloading $nodename.json"
curl -v \
-H "${{ secrets.SSHSTATS_API_AUTH_KEY }}: ${{ secrets.SSHSTATS_API_AUTH_VALUE }}" \
--output-dir fe/data/logins \
-o "$nodename.json" \
"${{ env.SSHSTATS_BACKEND }}/stats/$nodename"
done
- name: store attempts data
uses: actions/upload-artifact@v4
with:
name: attempts-data
path: |
fe/data/logins/*.json
- name: move attempts data
run: |
mkdir -p ${{github.workspace}}/nginx
cp -v -R --parents logins ${{github.workspace}}/nginx
working-directory: ./fe/data
- name: configure nuxt
run: |
echo "NUXT_PUBLIC_BASE_URL=${{ env.SSHSTATS_NUXT_PUBLIC_BASE_URL }}" >> fe/.env
- name: npm ci
working-directory: ./fe
run: |
npm ci
- name: nuxt generate
working-directory: ./fe
run: |
npm run generate
- name: store static site
uses: actions/upload-artifact@v4
with:
name: ssg-data
path: |
fe/.output/public/