-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from canopas/deploy-production
Deploy production
- Loading branch information
Showing
13 changed files
with
192 additions
and
15 deletions.
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
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
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,62 @@ | ||
name: DeployProdBackend | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
deploy-backend: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.17.5' | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: arn:aws:iam::569704406482:role/github-actions-s3-access | ||
aws-region: ap-south-1 | ||
- name: Build backend | ||
run: | | ||
GOOS=linux GOARCH=amd64 go build -o main main.go | ||
- name: Zip function | ||
run: | | ||
apt-get update && apt-get install -y zip | ||
uuid=$(uuidgen) | ||
export ZIP_NAME="canopas-website-v1-${uuid}.zip" | ||
zip $ZIP_NAME main | ||
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV | ||
- name: Upload to S3 | ||
run: | | ||
aws s3 cp ${{ env.ZIP_NAME }} s3://prod-stack-canopas-backend/ | ||
- name: Deploy lambda function | ||
id: canopas-website-prod-backend-stack | ||
uses: aws-actions/aws-cloudformation-github-deploy@v1 | ||
with: | ||
name: canopas-website-prod-backend-stack | ||
template: infrastructure/template-backend.yml | ||
capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM | ||
timeout-in-minutes: "5" | ||
no-fail-on-empty-changeset: "1" | ||
parameter-overrides: >- | ||
EnvName=prod, | ||
S3BucketName=prod-stack-canopas-backend, | ||
CustomDomainName=prod-stack-api.canopas.com, | ||
LambdaHandlerPath=main, | ||
LambdaZipFilePath=${{ env.ZIP_NAME }}, | ||
Sender=${{ secrets.SENDER }}, | ||
Receiver=${{ secrets.RECEIVER }}, | ||
AccessKeyId=${{ secrets.ACCESS_KEY_ID }}, | ||
SecretAccessKey=${{ secrets.SECRET_ACCESS_KEY }}, | ||
Region=${{ secrets.AWS_REGION }} | ||
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,53 @@ | ||
name: DeployProdFrontend | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
deploy-frontend: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: arn:aws:iam::569704406482:role/github-actions-s3-access | ||
aws-region: ap-south-1 | ||
|
||
- name: Deploy cloudfront | ||
id: canopas-website-prod-frontend-stack | ||
uses: aws-actions/aws-cloudformation-github-deploy@v1 | ||
with: | ||
name: canopas-website-prod-frontend-stack | ||
template: infrastructure/template-frontend.yml | ||
capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM | ||
timeout-in-minutes: "10" | ||
no-fail-on-empty-changeset: "1" | ||
parameter-overrides: >- | ||
S3BucketName=prod-stack-canopas-v1-frontend, | ||
CustomDomainName=canopas.com | ||
- name: Build frontend | ||
run: | | ||
cd vue-frontend | ||
npm ci | ||
mv src/config.prod.js src/config.js | ||
npm run build | ||
- name: Upload to S3 | ||
run: | | ||
cd vue-frontend | ||
aws s3 sync --delete --cache-control 'max-age=31536000' --exclude *.html dist/ s3://prod-stack-canopas-v1-frontend/ | ||
aws s3 sync --cache-control 'no-cache' dist/ s3://prod-stack-canopas-v1-frontend/ |
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
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
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
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
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
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
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
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
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,12 @@ | ||
export default Object.freeze({ | ||
FACEBOOK_URL: "https://www.facebook.com/canopassoftware", | ||
TWITTER_URL: "https://twitter.com/canopassoftware", | ||
GITHUB_URL: "https://github.com/canopas", | ||
INSTAGRAM_URL: "https://www.instagram.com/canopassoftware/", | ||
LINKEDIN_URL: "https://www.linkedin.com/company/canopasinc", | ||
MEDIUM_URL: "https://medium.com/canopas", | ||
BLOG_URL: "https://blog.canopas.com", | ||
JOBS_URL: "https://jobs.canopas.com", | ||
API_BASE: "https://prod-stack-api.canopas.com", | ||
CALENDLY_IFRAME_URL: "https://calendly.com/darpanvithani/15min", | ||
}); |