Skip to content

1.16.3

1.16.3 #149

Workflow file for this run

name: Release
on:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v2.1.3
jobs:
update-database:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 16
uses: actions/setup-node@v1
env:
NEO4J_HOST: ${{ secrets.PROD_NEO4J_HOST }}
NEO4J_USERNAME: ${{ secrets.PROD_NEO4J_USERNAME }}
NEO4J_PASSWORD: ${{ secrets.PROD_NEO4J_PASSWORD }}
with:
node-version: "16"
- name: Install NPM Dependencies
run: npm install
# Sync content to production DB
- name: Sync content to Prod Instance
env:
NEO4J_HOST: ${{ secrets.PROD_NEO4J_HOST }}
NEO4J_USERNAME: ${{ secrets.PROD_NEO4J_USERNAME }}
NEO4J_PASSWORD: ${{ secrets.PROD_NEO4J_PASSWORD }}
run: npm run sync:content
# Test the database
- name: Test Database
env:
NEO4J_HOST: ${{ secrets.PROD_NEO4J_HOST }}
NEO4J_USERNAME: ${{ secrets.PROD_NEO4J_USERNAME }}
NEO4J_PASSWORD: ${{ secrets.PROD_NEO4J_PASSWORD }}
run: npm run test:db
sync-assets:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# Sync images to CDN
- name: Sync public/ to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: ${{ secrets.GA_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AC_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AC_ACCESS_KEY_ID }}
AWS_REGION: ${{ secrets.GA_AWS_REGION }}
SOURCE_DIR: "public"
DEST_DIR: "assets"
restart-cluster:
runs-on: ubuntu-latest
needs:
- update-database
steps:
# Configure AWS
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AC_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AC_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.GA_AWS_REGION }}
# Restart cluster to download new content
- name: Restart Cluster
uses: kenju/kubernetes-action@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
with:
args: "rollout restart -n graphacademy-prod deployment/graphacademy"
invalidate-cache:
runs-on: ubuntu-latest
needs:
- sync-assets
steps:
# Configure AWS
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AC_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AC_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.GA_AWS_REGION }}
# Invalidate the CDN cache
- name: Invalidate CloudFront Cache
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.GA_CLOUDFRONT_DISTRIBUTION }}
PATHS: "/*"
AWS_REGION: ${{ secrets.GA_AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.DEVREL_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEVREL_SECRET_ACCESS_KEY }}