-
Notifications
You must be signed in to change notification settings - Fork 24
51 lines (49 loc) · 1.64 KB
/
deploy.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
name: deploy
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Git LFS
run: |
sudo apt-get update
sudo apt-get install git-lfs
git lfs install
- run: git lfs pull
- uses: actions/setup-node@v1 #this installs node and npm for us
with:
node-version: '18.x'
- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm config set "@fortawesome:registry" https://npm.fontawesome.com && npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONT }}
- run: npm install
- run: npm install -g @angular/cli > /dev/null
- run: npm run stage-prod-keys
env:
PROD_API_KEY: ${{ secrets.API_KEY }}
PROD_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
PROD_DIM_API_KEY: ${{ secrets.DIM_API_KEY }}
- run: ng build --configuration production
- name: copy file via ssh key
uses: appleboy/scp-action@v0.1.3
env:
HOST: ${{ secrets.HOST }}
USERNAME: ${{ secrets.UID }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSH }}
with:
source: "./dist/"
target: "/home/${{ secrets.UID }}/d2checklist/"
strip_components: 2 # this is important