Skip to content

Commit

Permalink
chore: set environment for github action
Browse files Browse the repository at this point in the history
  • Loading branch information
namhoang1604 committed Aug 31, 2023
1 parent 9d01b02 commit 610ddc7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 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 @@ -3,6 +3,11 @@ name: Build and Deploy Agent
on:
push:
branches:
- dev
- next
pull_request:
branches:
- dev
- next

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

environment: ${{ (github.ref == 'refs/heads/dev' && '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
9 changes: 7 additions & 2 deletions .github/workflows/deploy-to-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Deploy to S3
on:
push:
branches:
- dev
- next

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

environment: ${{ (github.ref == 'refs/heads/dev' && '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 @@ -63,6 +66,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 @@ -79,7 +84,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 610ddc7

Please sign in to comment.