Deploy #11129
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 | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
schedule: | |
- cron: '0 * * * *' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: ${{ github.event_name != 'schedule' }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Pocketmon | |
uses: actions/checkout@v4 | |
with: | |
path: PocketMon | |
- name: Checkout pkmn/smogon | |
uses: actions/checkout@v4 | |
with: | |
repository: pkmn/smogon | |
path: smogon | |
- name: Checkout pkmn/randbats | |
uses: actions/checkout@v4 | |
with: | |
repository: pkmn/randbats | |
path: randbats | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Install dependencies | |
run: npm -C PocketMon ci | |
- name: Test | |
run: npm -C PocketMon test # runs build | |
- name: Copy pkmn/smogon data | |
run: cp -a smogon/data PocketMon/dist | |
- name: Copy pkmn/randbats data | |
run: cp -a randbats/data/stats PocketMon/dist/data/random | |
- name: Compute build data/index.json | |
run: node PocketMon/build smogon randbats > PocketMon/dist/assets.json | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: PocketMon/dist | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |