-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
293 changed files
with
2,836 additions
and
6,393 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Deploy assets to AWS S3 and GCP Cloud Storage with hold state setup in github's production environment | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
bucket: | ||
required: false | ||
type: string | ||
default: analytics | ||
directory: | ||
required: true | ||
type: string | ||
cache-control: | ||
required: false | ||
type: string | ||
default: no-cache | ||
secrets: | ||
AWS_ACCESS_KEY_ID: | ||
required: true | ||
AWS_SECRET_ACCESS_KEY: | ||
required: true | ||
GCP_SA_KEY: | ||
required: true | ||
|
||
jobs: | ||
deploy-aws: | ||
runs-on: ubuntu-latest | ||
environment: production # sets in github repo with reviewer requirement protection rule | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download build-output-US artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: build-output-US | ||
path: dist/ | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1-node16 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
- name: Deploy to S3 | ||
run: | | ||
aws s3 cp ./dist/ s3://assets.sitescdn.net/${{ inputs.bucket }}/${{ inputs.directory }} \ | ||
--acl public-read \ | ||
--recursive \ | ||
--cache-control ${{ inputs.cache-control }} | ||
deploy-gcp: | ||
runs-on: ubuntu-latest | ||
environment: production # sets in github repo with reviewer requirement protection rule | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download build-output-EU artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: build-output-EU | ||
path: dist/ | ||
- name: Authenticate to Google Cloud | ||
id: auth | ||
uses: google-github-actions/auth@v1 | ||
with: | ||
credentials_json: "${{ secrets.GCP_SA_KEY }}" | ||
- name: Deploy to GCP Bucket | ||
uses: google-github-actions/upload-cloud-storage@v1 | ||
with: | ||
path: dist/ | ||
parent: false | ||
destination: assets-eu.sitescdn.net/${{ inputs.bucket }}/${{ inputs.directory }} | ||
process_gcloudignore: false | ||
headers: |- | ||
cache-control: ${{ inputs.cache-control }} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules/ | ||
coverage/ | ||
dist/ | ||
lib/ | ||
temp/ | ||
.env | ||
|
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.