Deploy #56
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 to GitHub Pages | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 * * * * # This should run every thour this way we can get the "latest" prices fetched; todo: fetch previousHour candle also | |
workflow_run: | |
workflows: [Tests] | |
types: [completed] | |
branches: [main] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
env: | |
TZ: UTC | |
LANG: en_US.UTF-8 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
check-latest: true | |
node-version-file: .node-version | |
cache: npm | |
- run: npm ci | |
- uses: actions/cache/restore@v3 | |
id: cache | |
with: | |
path: data | |
key: jsonl-data | |
- run: npm run sync-coinbase | |
env: | |
npm_config_coinbase_api_key: ${{ secrets.coinbase_api_key }} | |
npm_config_coinbase_api_secret: ${{ secrets.coinbase_api_secret }} | |
npm_config_coinbase_api_base: ${{ vars.coinbase_api_base }} | |
- uses: actions/cache/save@v3 | |
with: | |
path: data | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- run: npm run build-coinbase | |
- run: npm run build-sitemap | |
- run: npm run build-coinbase-history | |
- run: npm run build-coinbase-latest | |
- run: npm run sync-coinbase-latest-prices | |
env: | |
npm_config_coinbase_api_key: ${{ secrets.coinbase_api_key }} | |
npm_config_coinbase_api_secret: ${{ secrets.coinbase_api_secret }} | |
npm_config_coinbase_api_base: ${{ vars.coinbase_api_base }} | |
- uses: actions/configure-pages@v3 | |
- uses: actions/upload-pages-artifact@v2 | |
with: | |
path: 'www' | |
deploy: | |
needs: build | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- id: deployment | |
uses: actions/deploy-pages@v2 |