Skip to content

Commit a5a40ef

Browse files
Merge pull request #25 from Cardinal-Cryptography/bj-add-prod-env
SD-1: Add prod environment deployment workflows
2 parents 6faf4e2 + eadccee commit a5a40ef

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: (PROD) Build and deploy frontend
3+
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-and-push:
9+
name: Build and push
10+
runs-on: ubuntu-24.04
11+
environment:
12+
name: prod
13+
steps:
14+
- name: GIT | Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Export variables
18+
env:
19+
VARS_CONTEXT: ${{ toJson(vars) }}
20+
run: |
21+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
22+
to_envs() { jq -r "to_entries[] | select(.key|startswith(\"PUBLIC_VAR\")) | \"\(.key)<<$EOF\n\(.value)\n$EOF\n\""; }
23+
echo "$VARS_CONTEXT" | to_envs >> $GITHUB_ENV
24+
25+
- name: Build and deploy - PROD
26+
uses: ./.github/actions/build-and-push
27+
with:
28+
environment: prod
29+
aws-access-key-id: ${{ secrets.AWS_S3_PROD_ACCESS_KEY_ID }}
30+
aws-secret-access-key: ${{ secrets.AWS_S3_PROD_SECRET_ACCESS_KEY }}
31+
s3-bucket-name: ${{ secrets.AWS_S3_PROD_BUCKET_NAME }}
32+
amplify-app-id: ${{ secrets.AWS_AMPLIFY_PROD_APP_ID }}
33+
npm-token: ${{ secrets.NPM_TOKEN }}

.github/workflows/build-and-push-stage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
build-and-push:
99
name: Build and push
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-24.04
1111
environment:
1212
name: stage
1313
steps:

0 commit comments

Comments
 (0)