forked from Converg3nce/matic-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.89 KB
/
master_deployment.yml
File metadata and controls
64 lines (55 loc) · 1.89 KB
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
name: Master deployment
on:
push:
paths:
- 'docs/**'
- 'i18n/**'
workflow_dispatch:
branches:
- master
jobs:
build:
strategy:
matrix:
locale: ['en']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: master
# Cache Docusaurus artifacts and node_modules
- name: Cache Docusaurus artifacts
id: cache-docusaurus
uses: actions/cache@v2
with:
path: |
.docusaurus
node_modules
key: ${{ runner.os }}-build-${{ matrix.locale }}-${{ hashFiles('.docusaurus/**', 'node_modules/**') }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.locale }}-
${{ runner.os }}-build-
${{ runner.os }}-
# Install dependencies and build
- name: Install dependencies and build
run: |
yarn install --frozen-lockfile
yarn build --locale ${{ matrix.locale }}
- name: Uploading to s3 bucket
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.POLYGON_AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.POLYGON_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.POLYGON_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
SOURCE_DIR: ${{secrets.TARGET_DIRECTORY}}
- name: invalidate cloudfront distribution and wait for completion
uses: muratiger/invalidate-cloudfront-and-wait-for-completion-action@master
env:
DISTRIBUTION_ID: ${{ secrets.POLYGON_CLOUDFRONT_DISTRIBUTION_ID }}
PATHS: '/*'
AWS_REGION: 'us-east-1'
AWS_ACCESS_KEY_ID: ${{ secrets.POLYGON_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.POLYGON_AWS_SECRET_ACCESS_KEY }}