1.18.6 #190
Workflow file for this run
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: 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_SECRET_ACCESS_KEY }} | |
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@v4 | |
with: | |
aws-access-key-id: ${{ secrets.GA_DEPLOY_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.GA_DEPLOY_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Rollout | |
uses: kodermax/kubectl-aws-eks@main | |
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.AC_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AC_SECRET_ACCESS_KEY }} |