Skip to content

Merge pull request #87 from postmanlabs/MARKENG-3376 #64

Merge pull request #87 from postmanlabs/MARKENG-3376

Merge pull request #87 from postmanlabs/MARKENG-3376 #64

Workflow file for this run

name: Deploy to Beta
permissions:
id-token: write
contents: read
on:
workflow_dispatch:
push:
branches:
- 'develop'
env:
BRANCH: ${{github.ref_name}}
jobs:
build:
runs-on: ubuntu-latest
environment: Beta
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: '14'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.BETA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.BETA_AWS_SECRET_ACCESS_KEY }}
- name: Sanitize Branch Name
id: sanitized-branch
run: |
echo "SANITIZED_BRANCH="$(echo "${{env.BRANCH}}" | tr "/" "-" | tr "[:upper:]" "[:lower:]")"" >> $GITHUB_OUTPUT
- name: set keys and deploy
env:
AWS_MAX_ATTEMPTS: 10
DIST_ID: ${{secrets.BETA_DIST_ID}}
MUNCHKIN_ID: ${{ secrets.MUNCHKIN_ID}}
BFF_BLOG_URL: ${{ secrets.BFF_BLOG_URL }}
BFF_FOOTER_URL: ${{ secrets.BFF_FOOTER_URL }}
BFF_NAVBAR_URL: ${{ secrets.BFF_NAVBAR_URL }}
BFF_PING_WEBHOOK_URL: $ {{ secrets.BFF_PING_WEBHOOK_URL }}
RELIC_ACCOUNT_ID: ${{ secrets.RELIC_ACCOUNT_ID }}
RELIC_TRUST_KEY: ${{ secrets.RELIC_TRUST_KEY }}
RELIC_LICENSE_KEY: ${{ secrets.RELIC_LICENSE_KEY }}
RELIC_PRODUCTION_AGENT_ID: ${{ secrets.RELIC_PRODUCTION_AGENT_ID }}
RELIC_PRODUCTION_APPLICATION_ID: ${{ secrets.RELIC_PRODUCTION_APPLICATION_ID }}
PM_TECH_RT: ${{secrets.PM_TECH_RT}}
SITE_URL: ${{secrets.BETA_SITE_URL}}
DOMAIN_NAME: ${{secrets.BETA_DOMAIN_NAME}}
run: |
npm config set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
npm install
npm run clean
npm run build:dev
aws s3 sync ./public/ s3://${{secrets.BETA_BUCKET_NAME}}/${{ steps.sanitized-branch.outputs.SANITIZED_BRANCH}}/collection-format --delete
aws cloudfront create-invalidation --distribution-id ${{secrets.BETA_DIST_ID}} --paths "/*"