-
Notifications
You must be signed in to change notification settings - Fork 81
39 lines (37 loc) · 1.09 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
name: Build and Deploy Docs
on:
workflow_dispatch: # This enables manual runs. Just in case.
push:
branches:
- main
- develop
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::338683922796:role/semgrep-docs-deploy-role
role-duration-seconds: 900
role-session-name: deploy
aws-region: us-west-2
- name: Deploy to staging
if: github.ref == 'refs/heads/develop'
run: aws s3 sync build/ s3://staging-semgrep-dev/docs --delete
- name: Deploy to production
if: github.ref == 'refs/heads/main'
run: aws s3 sync build/ s3://semgrep-docs/docs --delete