-
Notifications
You must be signed in to change notification settings - Fork 14
42 lines (36 loc) · 1.13 KB
/
deploy-assets-staging.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
on:
push:
branches:
- main
jobs:
build_css:
runs-on: ubuntu-latest
env:
source: public/dist/assets
destination: assets/website-2021/
steps:
- name: Checkout source Git branch
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install npm modules
run: npm install
- name: compile assets
run: npm run build
- name: Upload to cdn-staging.w3.org bucket
if: success()
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
run:
aws s3 sync --no-progress ${{ env.source }} s3://cdn-staging.w3.org/${{ env.destination }}
- name: Purge cache for www-staging.w3.org
uses: nathanvaughn/actions-cloudflare-purge@master
if: success()
with:
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
cf_auth: ${{ secrets.CLOUDFLARE_CACHEPURGE_TOKEN }}
prefixes: www-staging.w3.org/${{ env.destination }}