-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (84 loc) · 2.49 KB
/
continuous-integration.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Decrypt, Build, Deploy
on:
push:
branches:
- main
paths-ignore:
- ./**.md
workflow_dispatch:
concurrency: # Does this stuff even work?
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
decrypt:
name: 🔐 Decrypt
runs-on: ubuntu-latest
outputs:
current_date: ${{ steps.get_date.outputs.CURRENT_DATE }}
steps:
- name: Checkout repo
uses: actions/[email protected]
- name: Setup Node
uses: actions/[email protected]
- name: Install dependencies
run: npm install
- name: Decrypt with OpenSSL
env:
WEB_SOURCE_PASS: ${{ secrets.WEB_SOURCE_PASS }} # There's nothing you can do >:)
run: openssl enc -d -aes-256-cbc -in source_encrypted.enc -out src.zip -pass env:WEB_SOURCE_PASS
- name: Unzip decrypted source
run: unzip -o -qq src.zip
- name: Get date
id: get_date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
- name: Save source
uses: actions/cache/[email protected]
with:
path: ./src
key: decrypted-source-${{ steps.get_date.outputs.CURRENT_DATE }}
build:
name: 🛠️ Build
runs-on: ubuntu-latest
needs: decrypt
steps:
- name: Checkout repo
uses: actions/[email protected]
- name: Setup Node
uses: actions/[email protected]
- name: Restore cached source
uses: actions/cache/restore@v4
with:
path: ./src
key: decrypted-source-${{ needs.decrypt.outputs.current_date }}
- name: Install dependencies
run: npm install
- name: Compile CSS
run: npm run css
- name: Build project
run: npm run build
- name: Create 404 page
run: cp ./dist/{index.html,404.html}
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload build files
uses: actions/[email protected]
with:
name: Compiled site
path: ./dist
deploy:
name: 📤 Deploy
runs-on: ubuntu-latest
needs: build
environment: GitHub Pages (Vite)
steps:
- name: Checkout repo
uses: actions/[email protected]
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]
with:
artifact_name: Compiled site