2022-10-26 20:44:48 -06:00
|
|
|
name: Cloud-Deploy
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
# # Publish semver tags as releases.
|
2023-07-16 13:55:29 -06:00
|
|
|
release:
|
|
|
|
types: [published]
|
2022-10-26 20:44:48 -06:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
name: deploy
|
|
|
|
runs-on: ubuntu-latest
|
2022-10-26 23:21:25 -06:00
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
contents: read
|
2022-10-27 00:52:24 -06:00
|
|
|
deployments: write
|
2022-10-26 20:44:48 -06:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
2023-10-03 15:46:49 -06:00
|
|
|
node-version: 20.x
|
2022-10-26 20:44:48 -06:00
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
2023-10-03 15:46:49 -06:00
|
|
|
go-version: '1.21.1'
|
2022-10-26 20:44:48 -06:00
|
|
|
- run: go version
|
|
|
|
- run: |
|
2023-05-12 15:34:27 -06:00
|
|
|
make dep-frontend
|
2022-10-26 20:44:48 -06:00
|
|
|
cd frontend
|
2022-10-28 20:01:20 -06:00
|
|
|
yarn run build -- --configuration cloud_sandbox --output-path=../dist
|
2022-10-26 23:21:25 -06:00
|
|
|
|
|
|
|
- name: Configure AWS credentials using delegated access
|
|
|
|
uses: aws-actions/configure-aws-credentials@v1
|
|
|
|
with:
|
|
|
|
role-to-assume: arn:aws:iam::410145376638:role/fasten-sandbox-app-gh-frontend-deploy-role
|
|
|
|
aws-region: us-east-1
|
|
|
|
|
|
|
|
- name: Copy files to the test website with the AWS CLI
|
|
|
|
run: |
|
2022-10-30 13:21:25 -06:00
|
|
|
rm -rf dist/index.html
|
|
|
|
mv dist/index-cloud.html dist/index.html
|
2022-10-28 21:23:56 -06:00
|
|
|
aws s3 sync dist s3://app-sandbox.fastenhealth.com --acl public-read
|
2022-10-26 23:21:25 -06:00
|
|
|
|
2022-10-27 00:45:33 -06:00
|
|
|
- uses: chrnorm/deployment-action@v2
|
|
|
|
name: Create GitHub deployment
|
|
|
|
id: deployment
|
|
|
|
with:
|
|
|
|
token: '${{ github.token }}'
|
2022-11-02 09:32:09 -06:00
|
|
|
environment-url: https://app-sandbox.fastenhealth.com/
|
2022-10-27 00:45:33 -06:00
|
|
|
environment: sandbox
|
|
|
|
initial-status: success
|
2022-10-26 20:44:48 -06:00
|
|
|
|