Merge pull request #616 from CityOfPhiladelphia/main #77
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: Build, Check And Deploy to Prod | |
on: | |
push: | |
branches: | |
- production | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
cache: 'npm' | |
- name: install npm 6 | |
run: | | |
npm install -g npm@6 | |
- name: npm install, and build | |
run: | | |
printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}" >> ~/.npmrc | |
git config --global url."https://".insteadOf ssh:// | |
npm ci | |
npm run build | |
env: | |
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }} | |
VUE_APP_CYCLOMEDIA_API_KEY: ${{ secrets.VUE_APP_CYCLOMEDIA_API_KEY }} | |
VUE_APP_CYCLOMEDIA_PASSWORD: ${{ secrets.VUE_APP_CYCLOMEDIA_PASSWORD }} | |
VUE_APP_CYCLOMEDIA_USERNAME: ${{ secrets.VUE_APP_CYCLOMEDIA_USERNAME }} | |
VUE_APP_GATEKEEPER_KEY: ${{ secrets.VUE_APP_GATEKEEPER_KEY }} | |
- name: Deploy to Prod s3, Set index headers, and Invalidate Cloudfront | |
env: | |
AWS_DEFAULT_REGION: 'us-east-1' | |
AWS_S3_BUCKET: property.phila.gov | |
AWS_CLOUDFRONT_DISTRIBUTION: E1C3NOME1SMXKK | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: | | |
aws s3 sync dist s3://$AWS_S3_BUCKET --region us-east-1 --delete | |
aws s3 cp s3://$AWS_S3_BUCKET s3://$AWS_S3_BUCKET --recursive --exclude "*" --include "*.html" --metadata-directive REPLACE --acl public-read --cache-control max-age=0,no-cache,no-store,must-revalidate,proxy-revalidate,public --expires "0" --content-type "text/html; charset=utf-8" | |
aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION --paths "/*" | |
- name: MS Teams Card | |
uses: toko-bifrost/ms-teams-deploy-card@master | |
with: | |
github-token: ${{ github.token }} | |
webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }} | |
environment: ${{ steps.global-vars.outputs.aws_env_prefix }} | |
card-layout-start: cozy |