-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (33 loc) · 955 Bytes
/
deploy.yml
File metadata and controls
40 lines (33 loc) · 955 Bytes
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
name: Deploy
on:
workflow_run:
workflows: ["Build"]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Using node_modules cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Using build cache
id: build-cache
uses: actions/cache@v3
with:
path: public
key: ${{ runner.os }}-${{ github.sha }}
- if: steps.build-cache.outputs.cache-hit == 'true'
name: Deploy
run: |
echo "Cache found"
echo "Starting deployment"
npm run deploy -- ${{ secrets.FTP_HOST }} ${{ secrets.FTP_USER }} ${{ secrets.FTP_PASSWORD }}
- if: steps.build-cache.outputs.cache-hit != 'true'
name: Deploy fail
run: |
echo "Cache not found!"
exit 1