Merge pull request #2088 from methodic-labs/fix/CHRONICLE-135-skip-qu… #137
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
name: deploy-staging | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: node 16 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: npm config | |
env: | |
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }} | |
run: | | |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/ | |
npm config set "//npm.fontawesome.com/:_authToken" "$FONTAWESOME_NPM_AUTH_TOKEN" | |
- name: npm ci | |
run: npm ci | |
- name: npm run build:prod | |
run: npm run build:prod | |
- name: aws credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.GH_ACTIONS_RELEASE_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.GH_ACTIONS_RELEASE_AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.GH_ACTIONS_RELEASE_AWS_REGION }} | |
- name: deploy to s3 | |
run: | | |
aws s3 rm --recursive s3://app.staging.getmethodic.com/chronicle/ | |
aws s3 cp --recursive build/ s3://app.staging.getmethodic.com/chronicle/ | |
- name: clear cloudflare cache | |
run: | | |
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${{ secrets.METHODIC_CLOUDFLARE_ZONE_ID }}/purge_cache" \ | |
-H "X-Auth-Email: ${{ secrets.METHODIC_CLOUDFLARE_EMAIL }}" \ | |
-H "X-Auth-Key: ${{ secrets.METHODIC_CLOUDFLARE_API_KEY }}" \ | |
-H "Content-Type: application/json" \ | |
--data '{"files":["https://app.staging.getmethodic.com/chronicle"]}' |