v1.0.0-alpha2 #6
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: deploy_development | |
on: | |
release: | |
types: [prereleased] | |
env: | |
MAJORVERSION: '' | |
COMPONENT_NAME: ${{ github.event.repository.name }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout GitHub Action' | |
uses: actions/checkout@v4 | |
- 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: | | |
echo "::error title=Bad version format::The version specified does not follow semantic versioning" | |
exit 1 | |
- name: Get version from tag | |
run: echo "VERSION=${{ steps.get_version.outputs.version-without-v }}" >> $GITHUB_ENV | |
- name: Check that the builder file exists | |
if: ${{ hashFiles(format('builder/versions/{0}.{1}.json', github.event.repository.name, steps.get_version.outputs.version-without-v)) == '' }} | |
run: | | |
echo "::error file=builder/versions,title=Missing builder file::The builder file for $VERSION is missing from builder/versions" | |
exit 1 | |
- 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*" |