.github/workflows/deploy-gh.yml #460
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
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "0 0 * * *" | |
| jobs: | |
| build: | |
| permissions: | |
| id-token: write | |
| contents: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20.x' | |
| - name: Install dependencies | |
| run: npm install && npm i node-fetch && npm install lightningcss-linux-x64-gnu | |
| - name: Download data | |
| run: npm run download | |
| - name: Build dist | |
| run: npx expo export -p web | |
| - name: Commit changes | |
| run: | | |
| git config --local user.name "GitHub Actions" | |
| git config --local user.email "actions@github.com" | |
| git add . | |
| git diff-index --quiet HEAD || git commit -m "Download and rebuild data" | |
| - name: Push changes | |
| uses: ad-m/github-push-action@v0.6.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: main |