File tree 1 file changed +29
-10
lines changed
1 file changed +29
-10
lines changed Original file line number Diff line number Diff line change 1
- name : build- and-deploy
1
+ name : Build and Deploy
2
2
3
3
on :
4
4
push :
5
- branches : [ main ]
5
+ branches : [ " main", "feat/ci-cd" ]
6
6
7
7
jobs :
8
- build-and-deploy :
8
+ build :
9
9
runs-on : ubuntu-latest
10
10
steps :
11
11
- name : Setup Node.js
12
12
13
13
with :
14
14
node-version : v16.19.1
15
-
16
15
- name : Checkout 🛎️
17
16
18
-
19
17
- name : Build the website
18
+ shell : bash
20
19
run : |
21
20
npm install
22
21
npm run generate
23
-
24
- - name : Deploy to GitHub Pages
25
-
22
+ - name : Pack static output
23
+ shell : bash
24
+ run : |
25
+ cd ./dist
26
+ tar -czvf /tmp/pet-informatica.github.io.tar.gz .
27
+ - name : Upload build artifact
28
+ uses : actions/upload-artifact@v2
26
29
with :
27
- branch : gh-pages
28
- folder : dist
30
+ name : StaticOutput
31
+ path : /tmp/pet-informatica.github.io.tar.gz
32
+ deploy :
33
+ runs-on :
34
+ - self-hosted
35
+ - linux
36
+ - x64
37
+ steps :
38
+ - name : Download build artifact
39
+ uses : actions/download-artifact@v2
40
+ with :
41
+ name : StaticOutput
42
+ - name : Unpack and deploy
43
+ shell : bash
44
+ run : |
45
+ rm -rf ${{ secrets.VM_PETSITE_PATH }}/*
46
+ tar -xzf pet-informatica.github.io.tar.gz -C ${{ secrets.VM_PETSITE_PATH }}
47
+ rm -rf pet-informatica.github.io.tar.gz
You can’t perform that action at this time.
0 commit comments