Repository navigation
deploy #350
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@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - 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 output --okapi https://back-okapi.reshare-dev.indexdata.com --tenant back --sourcemap && | |
| mv output back && | |
| STRIPES_TRANSPILE_TOKENS=@k-int yarn build output --okapi https://forth-okapi.reshare-dev.indexdata.com --tenant forth --sourcemap && | |
| mv output forth | |
| - name: copy yarn.lock to builds | |
| run: | | |
| cp yarn.lock back/ && cp yarn.lock forth/ | |
| - name: add a timestamp | |
| run: | | |
| echo "$GITHUB_ACTOR built this webpack on `date`" > back/date.txt && | |
| echo "$GITHUB_ACTOR built this webpack on `date`" > forth/date.txt | |
| - name: upload builds | |
| run: | | |
| ls && | |
| aws s3 sync ./back s3://reshare-bundles/back --acl public-read --delete && | |
| aws s3 sync ./forth s3://reshare-bundles/forth --acl public-read --delete | |
| - name: Invalidate CF Back | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id E8EDX09LVCH4C \ | |
| --paths "/*" | |
| - name: Invalidate CF Forth | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id EWKGQD0EOK4VN \ | |
| --paths "/*" |