-
Notifications
You must be signed in to change notification settings - Fork 7
65 lines (60 loc) · 3 KB
/
deploy_production_workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: deploy_production_workflow
on:
workflow_dispatch:
inputs:
version:
description: 'Version number'
required: true
default: '2'
type: string
env:
MAJORVERSION: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Get Version
id: get_version
uses: battila7/get-version-action@v2
- name: Get version from input
run: echo "VERSION=${GITHUB_BRANCH}" >> $GITHUB_ENV
env:
GITHUB_BRANCH: ${{ github.event.inputs.version }}
- name: Display version install
run: echo "Installing version ${VERSION}"
- run: npm install
- run: npm rebuild
- run: npm run-script build
- name: Configure AWS Credentials (DEPRECIATED)
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.CDN_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CDN_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Deploy toolbox to CDN BRAND S3 bucket for version (DEPRECIATED)
run: aws s3 sync ./dist/ s3://cdn.brand.illinois.edu/toolkit/$VERSION --delete --acl bucket-owner-full-control
- name: Build examples for version (DEPRECIATED)
run: npm run-script create-test-html -- --pathprefix=toolkit/$VERSION/examples/
- name: Deploy examples to CDN BRAND S3 bucket for version (DEPRECIATED)
run: aws s3 sync ./var/full-site-deploy/ s3://cdn.brand.illinois.edu/toolkit/$VERSION/examples --delete --acl bucket-owner-full-control
- name: Deploy static images in examples to CDN BRAND S3 bucket for version (DEPRECIATED)
run: aws s3 sync ./tests/_reference/ s3://cdn.brand.illinois.edu/toolkit/$VERSION/examples/static-images --acl bucket-owner-full-control
- name: Invalidate Cloudfront cache for version (DEPRECIATED)
run: aws cloudfront create-invalidation --distribution-id E2VPGHCUOM84HO --paths "/toolkit/$VERSION*"
- 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 version
run: aws s3 sync ./dist/ s3://cdn.toolkit.illinois.edu/content/$VERSION --delete --acl bucket-owner-full-control
- name: Build examples for version
run: npm run-script create-test-html -- --pathprefix=$VERSION/examples/
- name: Deploy examples to S3 bucket for version
run: aws s3 sync ./var/full-site-deploy/ s3://cdn.toolkit.illinois.edu/content/$VERSION/examples --delete --acl bucket-owner-full-control
- name: Deploy static images in examples to S3 bucket for version
run: aws s3 sync ./tests/_reference/ s3://cdn.toolkit.illinois.edu/content/$VERSION/examples/static-images --acl bucket-owner-full-control
- name: Invalidate Cloudfront cache for version
run: aws cloudfront create-invalidation --distribution-id EXFMUB66J7AM8 --paths "/$VERSION*"