Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Merge pull request #539 from web-illinois/main #25

Merge pull request #539 from web-illinois/main

Merge pull request #539 from web-illinois/main #25

Workflow file for this run

name: deploy_minor
on:
push:
tags: [ '**' ]
pull_request:
tags: [ '**' ]
env:
MINORVERSION: ''
FULLVERSION: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Get Version
id: get_version
uses: battila7/get-version-action@v2
- name: Check for correct naming convention
if: ${{ !steps.get_version.outputs.is-semver }}
run: exit 1
- name: Get minor version from tag
run: echo "MINORVERSION=${GITHUB_BRANCH}.${GITHUB_BRANCH_MINOR}" >> $GITHUB_ENV
env:
GITHUB_BRANCH: ${{ steps.get_version.outputs.major }}
GITHUB_BRANCH_MINOR: ${{ steps.get_version.outputs.minor }}
- name: Get patch (full) version from tag
run: echo "FULLVERSION=${GITHUB_BRANCH}" >> $GITHUB_ENV
env:
GITHUB_BRANCH: ${{ steps.get_version.outputs.version-without-v }}
- name: Display version minor install
run: echo "Installing minor version ${MINORVERSION}"
- name: Display version patch (full) install
run: echo "Installing patch (full) version ${FULLVERSION}"
- run: npm install
- run: npm rebuild
- run: npm run-script build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: 'AKIAXNR47MADAISLEYYZ'
aws-secret-access-key: ${{ secrets.AWS_SECRET_FOR_AKIAXNR47MADAISLEYYZ }}
aws-region: us-east-2
- name: Deploy toolbox to S3 bucket for minor version if not prelease
if: ${{ steps.get_version.outputs.prerelease == '' }}
run: aws s3 sync ./dist/ s3://cdn.toolkit.illinois.edu/content/$MINORVERSION --delete --acl bucket-owner-full-control
- name: Build examples for minor version if not prelease
if: ${{ steps.get_version.outputs.prerelease == '' }}
run: npm run-script create-test-html -- --pathprefix=$MINORVERSION/examples/
- name: Deploy examples to S3 bucket for minor version if not prelease
if: ${{ steps.get_version.outputs.prerelease == '' }}
run: aws s3 sync ./var/full-site-deploy/ s3://cdn.toolkit.illinois.edu/content/$MINORVERSION/examples --delete --acl bucket-owner-full-control
- name: Deploy static images in examples to S3 bucket for minor version if not prelease
if: ${{ steps.get_version.outputs.prerelease == '' }}
run: aws s3 sync ./tests/_reference/ s3://cdn.toolkit.illinois.edu/content/$MINORVERSION/examples/static-images --acl bucket-owner-full-control
- name: Invalidate Cloudfront cache for minor version if not prelease
if: ${{ steps.get_version.outputs.prerelease == '' }}
run: aws cloudfront create-invalidation --distribution-id EXFMUB66J7AM8 --paths "/$MINORVERSION*"
- name: Deploy toolbox to S3 bucket for full version
run: aws s3 sync ./dist/ s3://cdn.toolkit.illinois.edu/content/$FULLVERSION --delete --acl bucket-owner-full-control
- name: Build examples for full version
run: npm run-script create-test-html -- --pathprefix=$FULLVERSION/examples/
- name: Deploy examples to S3 bucket for full version
run: aws s3 sync ./var/full-site-deploy/ s3://cdn.toolkit.illinois.edu/content/$FULLVERSION/examples --delete --acl bucket-owner-full-control
- name: Deploy static images in examples to S3 bucket for full version
run: aws s3 sync ./tests/_reference/ s3://cdn.toolkit.illinois.edu/content/$FULLVERSION/examples/static-images --acl bucket-owner-full-control
- name: Invalidate Cloudfront cache for full version
run: aws cloudfront create-invalidation --distribution-id EXFMUB66J7AM8 --paths "/$FULLVERSION*"