Repository navigation
deploy #338
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 output --okapi https://slnp-9-okapi.reshare-dev.indexdata.com --tenant slnptestnine --sourcemap && | |
| mv output nine && | |
| STRIPES_TRANSPILE_TOKENS=@k-int yarn build output --okapi https://slnp-10-okapi.reshare-dev.indexdata.com --tenant slnptestten --sourcemap && | |
| mv output ten && | |
| STRIPES_TRANSPILE_TOKENS=@k-int yarn build --tenant slnptesteleven --okapi https://slnp-11-okapi.reshare-dev.indexdata.com --sourcemap && | |
| mv output eleven && | |
| STRIPES_TRANSPILE_TOKENS=@k-int yarn build --tenant slnptesttwelve --okapi https://slnp-12-okapi.reshare-dev.indexdata.com --sourcemap && | |
| mv output twelve | |
| - name: copy yarn.lock to builds | |
| run: | | |
| cp yarn.lock nine/ && cp yarn.lock ten/ | |
| cp yarn.lock eleven/ && cp yarn.lock twelve/ | |
| - name: add a timestamp | |
| run: | | |
| echo "$GITHUB_ACTOR built this webpack on `date`" > nine/date.txt && | |
| echo "$GITHUB_ACTOR built this webpack on `date`" > ten/date.txt | |
| echo "$GITHUB_ACTOR built this webpack on `date`" > eleven/date.txt && | |
| echo "$GITHUB_ACTOR built this webpack on `date`" > twelve/date.txt | |
| - name: upload builds | |
| run: | | |
| ls && | |
| aws s3 sync ./nine s3://reshare-bundles/slnp_nine --acl public-read --delete && | |
| aws s3 sync ./ten s3://reshare-bundles/slnp_ten --acl public-read --delete | |
| # aws s3 sync ./eleven s3://reshare-bundles/slnp_eleven --acl public-read --delete && | |
| # aws s3 sync ./twelve s3://reshare-bundles/slnp_twelve --acl public-read --delete | |
| - name: Invalidate SLNP NINE | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id E33VJM0K839B74 \ | |
| --paths "/*" | |
| - name: Invalidate SLNP TEN | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id EL7IM3X2LSD0K \ | |
| --paths "/*" | |
| # - name: Invalidate SLNP ELEVEN | |
| # run: | | |
| # aws cloudfront create-invalidation \ | |
| # --distribution-id E1QGXYA1MACRL3 \ | |
| # --paths "/*" | |
| # - name: Invalidate SLNP TWELVE | |
| # run: | | |
| # aws cloudfront create-invalidation \ | |
| # --distribution-id E2MGEOMWHE17X6 \ | |
| # --paths "/*" |