-
Notifications
You must be signed in to change notification settings - Fork 22
128 lines (109 loc) · 3.16 KB
/
build-and-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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Build plugin
on:
push:
# Don't run for irrelevant changes.
paths-ignore:
- '__mocks__/**'
- '__static__/**'
- 'bin/**'
- 'packages/e2e-test-utils/**'
- 'packages/e2e-tests/**'
- 'packages/karma-*/**'
- 'plugin/tests/**'
- '**.md'
- '**.yml'
- '**.js.snap'
- '**.neon.dist'
- '**.xml.dist'
- '.editorconfig'
- '.eslint*'
- '.prettier*'
- '.stylelint*'
- '.github/workflows/**'
- '!.github/workflows/build-and-deploy.yml'
branches:
- develop
- full-site-editing
jobs:
build:
name: Build and package artifacts
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/[email protected]
with:
node-version-file: '.nvmrc'
cache: npm
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer
- name: Install dependencies
run: |
npm ci
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
- name: Install PHP dependencies
uses: 'ramsey/composer-install@v1'
with:
composer-options: '--prefer-dist --no-progress --no-interaction'
- name: Build plugin
run: |
npm run build
mkdir -p build/plugin/ build/theme
- name: Bundle regular version
run: |
unzip material-design.zip -d "build/plugin/"
unzip material-design-google.zip -d "build/theme/"
- name: Upload regular bundle
uses: actions/upload-artifact@v2
with:
name: material-design
path: build/
deploy-to-staging:
name: Deploy to staging environment
runs-on: ubuntu-latest
timeout-minutes: 5
needs: build
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download full bundle
uses: actions/download-artifact@v2
with:
name: material-design
path: build
- name: Setup SSH Keys and known_hosts
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PANTHEON_DEPLOY_KEY }}
- name: Run deployment
run: bash bin/deploy-to-staging.sh master
deploy-to-fse:
name: Deploy to fse environment
runs-on: ubuntu-latest
timeout-minutes: 5
needs: build
if: github.ref == 'refs/heads/full-site-editing' && github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download full bundle
uses: actions/download-artifact@v2
with:
name: material-design
path: build
- name: Setup SSH Keys and known_hosts
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PANTHEON_DEPLOY_KEY }}
- name: Run deployment to fse
run: bash bin/deploy-to-staging.sh fse
- name: Run deployment to traditional
run: bash bin/deploy-to-staging.sh traditional