forked from near/near-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.47 KB
/
bundle-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
name: Build and Deploy Frontend
on:
workflow_call:
inputs:
environment:
required: true
type: string
near_wallet_env:
required: true
type: string
jobs:
bundle-frontend:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
defaults:
run:
working-directory: packages/frontend
env:
NEAR_WALLET_ENV: ${{ inputs.near_wallet_env }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12.x
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test
- run: yarn bundle --outDir=dist/${{ inputs.environment }}
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
role-to-assume: ${{ secrets.AWS_DEPLOYMENT_ROLE }}
role-skip-session-tagging: true
role-duration-seconds: 900
- if: ${{ github.event_name == 'pull_request' }}
run: aws s3 sync dist/${{ inputs.environment }} s3://${{ secrets.S3_BUCKET }}/${{ github.event.pull_request.number }} --delete
- if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/stable') }}
run: aws s3 sync dist/${{ inputs.environment }} s3://${{ secrets.S3_BUCKET }} --delete