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