diff --git a/.github/workflows/deploy3_workflow.yml b/.github/workflows/deploy3_workflow.yml new file mode 100644 index 00000000..8cc8e0fb --- /dev/null +++ b/.github/workflows/deploy3_workflow.yml @@ -0,0 +1,40 @@ +name: deploy3_workflow +on: + workflow_dispatch: + inputs: + version: + description: 'Version number' + required: true + default: '' + 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 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: 'AKIAXNR47MADGK2A4HEW' + aws-secret-access-key: ${{ secrets.AWS_SECRET_FOR_AKIAXNR47MADGK2A4HEW }} + aws-region: us-east-2 + - name: Delete S3 bucket in dev area + run: aws s3 rm s3://cdn.toolkit.illinois.edu/content/$VERSION --recursive + - name: Deploy toolbox to S3 bucket in dev area + run: aws s3 sync ./dist/ s3://cdn.toolkit.illinois.edu/content/$VERSION --delete --acl bucket-owner-full-control