-
Notifications
You must be signed in to change notification settings - Fork 17
82 lines (74 loc) · 2.26 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
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
name: Deploy Theme
on:
pull_request:
push:
jobs:
pre_build:
continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v4
with:
concurrent_skipping: "same_content_newer"
paths_ignore: '["CONTRIBUTING.md", "LICENSE", "**/README.md"]'
build:
needs: pre_build
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || needs.pre_build.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Cache Node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run test:ci
- run: npm run zip
- run: unzip dist/dawn-advisory-theme.zip -d dist/
- run: rm dist/dawn-advisory-theme.zip
- name: Upload build
uses: actions/upload-artifact@v1
with:
name: dawn-advisory-theme-${{ github.sha }}
path: dist/
deploy:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Cache Node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run zip
- name: Deploy Ghost theme
uses: TryGhost/action-deploy-theme@v1.4.1
with:
api-url: ${{ secrets.GHOST_API_URL }}
api-key: ${{ secrets.GHOST_DEPLOY_THEME_ADMIN_API_KEY }}
exclude: "dist/* node_modules/*"