Skip to content

Commit

Permalink
chore: deploy un
Browse files Browse the repository at this point in the history
Signed-off-by: Nam Hoang <[email protected]>
  • Loading branch information
namhoang1604 committed Sep 16, 2023
1 parent 14e357f commit 05db15e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/build-and-deploy-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ on:
push:
branches:
- dev
- deploy-un
tags:
- '*'

env:
environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}

jobs:
install_and_build:
Expand All @@ -20,7 +21,9 @@ jobs:
env:
CI: false

environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment:
name: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}
url: ${{ env.environment == 'UN' && 'https://test.uncefact.org/vckit/explorer/' || 'https://explorer.vckit.showthething.com/' }}

steps:
- name: Checkout repository
Expand All @@ -30,6 +33,10 @@ jobs:
run: |
sudo apt-get -q install -y python3-pip
pip3 install awscli --upgrade --user
- name: Log
run: |
echo ${{ env.environment }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
Expand Down Expand Up @@ -68,7 +75,9 @@ jobs:
permissions:
id-token: write

environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment:
name: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}
url: ${{ env.environment == 'UN' && 'https://test.uncefact.org/vckit/explorer/' || 'https://explorer.vckit.showthething.com/' }}

steps:
- name: Checkout repository
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/deploy-to-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ on:
push:
branches:
- dev
- deploy-un
tags:
- '*'

env:
environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}

jobs:
install_and_build:
Expand All @@ -17,7 +18,9 @@ jobs:
env:
CI: false

environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment:
name: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}
url: ${{ env.environment == 'UN' && 'https://test.uncefact.org/vckit/explorer/' || 'https://explorer.vckit.showthething.com/' }}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -71,7 +74,9 @@ jobs:
permissions:
id-token: write

environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment:
name: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}
url: ${{ env.environment == 'UN' && 'https://test.uncefact.org/vckit/explorer/' || 'https://explorer.vckit.showthething.com/' }}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -99,6 +104,7 @@ jobs:
if: ${{ env.environment == 'UN' }}
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_GITHUB_ACTION_ARN }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
Expand Down

0 comments on commit 05db15e

Please sign in to comment.