deploy #332
This file contains hidden or 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 | |
| on: | |
| workflow_dispatch: | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_DEFAULT_REGION: 'us-east-1' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout module | |
| uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| - name: Install Yarn | |
| run: npm install -g yarn | |
| - name: prepare | |
| run: yarn config set @folio:registry https://repository.folio.org/repository/npm-folio/ | |
| - name: Do yarn install | |
| run: yarn install | |
| - name: Upload yarn.lock | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: yarn.lock | |
| path: yarn.lock | |
| - name: run build scripts | |
| run: | | |
| ./node_modules/.bin/stripes mod descriptor stripes.config.js --output ./ModuleDescriptors && | |
| STRIPES_TRANSPILE_TOKENS=@k-int yarn build --tenant slnptest_one --okapi https://slnp-1-okapi.reshare-dev.indexdata.com --sourcemap && | |
| mv output one && | |
| STRIPES_TRANSPILE_TOKENS=@k-int yarn build --tenant slnptest_two --okapi https://slnp-2-okapi.reshare-dev.indexdata.com --sourcemap && | |
| mv output two | |
| - name: Post new module descriptors | |
| run: | | |
| /usr/bin/python3 .github/workflows/scripts/reshare_ui_mds.py \ | |
| -u "okapi_admin" \ | |
| -p ${{ secrets.OKAPI_ADMIN_PW }} \ | |
| - name: copy yarn lock to yarn text | |
| run: cp yarn.lock one/yarn.txt && | |
| cp yarn.lock two/yarn.txt | |
| - name: upload builds | |
| run: | | |
| ls && | |
| aws s3 sync ./one s3://reshare-bundles/slnp_one --acl public-read --delete && | |
| aws s3 sync ./two s3://reshare-bundles/slnp_two --acl public-read --delete | |
| - name: Invalidate CF One | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id E3CYPB0489HZYL \ | |
| --paths "/*" | |
| - name: Invalidate CF Two | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id E24JH9M01TF89Q \ | |
| --paths "/*" |