-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add github actions for test deployment
- Loading branch information
1 parent
b303fe8
commit 3ca5fce
Showing
4 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Update BulkDownload Stack (prod) | ||
|
||
on: | ||
push: | ||
branches: | ||
- prod | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: test | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: build | ||
uses: ./.github/workflows/bulk-download-deploy-composite | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Update BulkDownload Stack (test) | ||
|
||
on: | ||
push: | ||
branches: | ||
- actions | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: test | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: build | ||
uses: ./.github/workflows/bulk-download-deploy-composite | ||
with: | ||
maturity: test | ||
application: ${{ vars.APPLICATION }} | ||
cdn-id: ${{ vars.CDN_ID }} | ||
s3-bucket: ${{ vars.S3_BUCKET }} | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Composite search-ui deploy action | ||
|
||
inputs: | ||
maturity: | ||
required: true | ||
type: string | ||
application: | ||
required: true | ||
type: string | ||
cdn-id: | ||
required: true | ||
type: string | ||
s3-bucket: | ||
required: true | ||
type: string | ||
aws-access-key-id: | ||
required: true | ||
type: string | ||
aws-secret-access-key: | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
cp src/app/services/envs/env-${{ inputs.maturity }}.ts src/app/services/env.ts | ||
echo "{\"hash\":\"${{ github.sha }}\"}" > src/assets/commit-hash.json | ||
npm install -g @angular/[email protected] | ||
npm install | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ inputs.aws-access-key-id }} | ||
aws-secret-access-key: ${{ inputs.aws-secret-access-key }} | ||
aws-region: "us-east-1" | ||
|
||
- name: Angular Build | ||
run: | | ||
ng build --configuration production | ||
- name: Deploy to AWS | ||
shell: bash | ||
run: | | ||
cd dist/${{ inputs.application }} | ||
aws s3 sync . "s3://${{ inputs.s3-bucket }}" | ||
aws cloudfront create-invalidation \ | ||
--distribution-id ${{ inputs.cdn-id }} \ | ||
--paths /index.html /manifest.json /ngsw.json /favicon.ico /assets/i18n/* /assets/* /docs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters