-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (37 loc) · 1.33 KB
/
deploy_development.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_development
on:
workflow_dispatch:
inputs:
version:
description: 'Version number'
required: true
default: ''
type: string
env:
MAJORVERSION: ''
COMPONENT_NAME: 'ilw-back-to-top' # set this to the web component name you are using
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 dev version ${VERSION}"
- 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
run: aws s3 sync ./dist/ s3://dev.toolkit.illinois.edu/content/$COMPONENT_NAME/$VERSION --delete --acl bucket-owner-full-control
- name: Invalidate Cloudfront cache
run: aws cloudfront create-invalidation --distribution-id ${{ vars.TOOLKIT_AWS_CLOUDFRONT_DEV }} --paths "/$COMPONENT_NAME/$VERSION*"