-
Notifications
You must be signed in to change notification settings - Fork 11
61 lines (54 loc) · 1.61 KB
/
master_deployment.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
name: Main deployment
on:
push:
branches:
- main
paths:
- 'docs/**'
- 'i18n/**'
workflow_dispatch:
jobs:
build:
name: build
permissions:
id-token: write
contents: write
environment: ${{ github.ref_name }}
strategy:
matrix:
locale: ['en']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::042947190491:role/zkevm-GithubActionsRole
role-session-name: GitHubActionsDeployment
# Fetch Git history
- name: Fetch Git history
run: git fetch --unshallow
# 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: |
export NODE_OPTIONS=--max-old-space-size=4096
yarn install --frozen-lockfile
yarn build --locale ${{ matrix.locale }}
- name: Uploading to s3 bucket
run: aws s3 sync ./build s3://${{ secrets.PROD_AWS_S3_BUCKET }}