Skip to content

Commit

Permalink
chore: set environment for github actions
Browse files Browse the repository at this point in the history
Signed-off-by: Nam Hoang <[email protected]>
(cherry picked from commit ea5d300)
  • Loading branch information
namhoang1604 committed Aug 31, 2023
1 parent 4680887 commit b0248a1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build-and-deploy-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
branches:
- demo
- next
pull_request:
branches:
- demo
- next

jobs:
install_and_build:
Expand All @@ -15,6 +20,8 @@ jobs:
env:
CI: false

environment: ${{ (github.ref == 'refs/heads/demo' && 'dev') || (github.ref == 'refs/heads/next' && 'UN') }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -25,7 +32,7 @@ jobs:
pip3 install awscli --upgrade --user
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_GITHUB_ACTION_ARN }}
aws-region: ${{ secrets.AWS_REGION }}
Expand All @@ -47,6 +54,8 @@ jobs:
permissions:
id-token: write

environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (github.ref == 'refs/heads/next' && 'UN') }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -57,7 +66,7 @@ jobs:
pip3 install awscli --upgrade --user
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_GITHUB_ACTION_ARN }}
aws-region: ${{ secrets.AWS_REGION }}
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/deploy-to-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
branches:
- demo
- next
pull_request:
branches:
- demo
- next

jobs:
install_and_build:
Expand All @@ -12,13 +17,15 @@ jobs:
env:
CI: false

environment: ${{ (github.ref == 'refs/heads/demo' && 'dev') || (github.ref == 'refs/heads/next' && 'UN') }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Cache dependencies
id: cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
Expand Down Expand Up @@ -47,14 +54,8 @@ jobs:
echo REACT_APP_DEFAULT_AGENT_ID=${{ vars.REACT_APP_DEFAULT_AGENT_ID }} >> .env
cat .env
- name: Build example documents
run: cd packages/example-documents && pnpm build

- name: Build renderer
run: cd packages/renderer && pnpm build

- name: Build explorer
run: cd packages/demo-explorer && pnpm build
run: pnpm build:js

- name: Archive artifacts
uses: actions/upload-artifact@v3
Expand All @@ -69,6 +70,8 @@ jobs:
permissions:
id-token: write

environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (github.ref == 'refs/heads/next' && 'UN') }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -85,7 +88,7 @@ jobs:
pip3 install awscli --upgrade --user
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_GITHUB_ACTION_ARN }}
aws-region: ${{ secrets.AWS_REGION }}
Expand Down

0 comments on commit b0248a1

Please sign in to comment.