forked from marvel-uiuc/template-ilw
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.38 KB
/
deploy_production_manual.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
name: deploy_production_manual
on:
workflow_dispatch:
inputs:
version:
description: 'Version number'
required: true
default: ''
type: string
env:
COMPONENT_NAME: ${{ github.event.repository.name }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- 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 production version ${VERSION} for component ${COMPONENT_NAME}"
- 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: ${{ vars.TOOLKIT_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.TOOLKIT_AWS_ACCESS_SECRET }}
aws-region: us-east-2
- name: Deploy toolbox to S3 bucket for version
run: aws s3 sync ./dist/ s3://cdn.toolkit.illinois.edu/content/$COMPONENT_NAME/$VERSION --delete --acl bucket-owner-full-control
- name: Invalidate Cloudfront cache for version
run: aws cloudfront create-invalidation --distribution-id ${{ vars.TOOLKIT_AWS_CLOUDFRONT }} --paths "/$COMPONENT_NAME/$VERSION*"