Fix: Duplicate results in table #313
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: Cloudflare and Github Pages' | |
on: | |
push: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
PAGES_PROJECT_NAME: optimizer | |
NODE_VERSION: 18 | |
concurrency: | |
group: 'deploy' | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
contents: read | |
deployments: write | |
pages: write | |
id-token: write | |
if: "!contains(github.event.head_commit.message, 'skip ci')" | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up PNPM | |
uses: pnpm/action-setup@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Cache Rust Output | |
id: rust-output-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
wasm_module/pkg | |
wasm_module/target | |
key: rust-output-${{ env.NODE_VERSION }}-${{ hashFiles('wasm_module', '**/pnpm-lock.yaml') }} | |
restore-keys: rust-output- | |
- name: Cache Rust Dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: wasm_module | |
if: steps.rust-output-cache.outputs.cache-hit != 'true' | |
- name: Compile Rust | |
run: pnpm wasm | |
if: steps.rust-output-cache.outputs.cache-hit != 'true' | |
- name: Build | |
run: pnpm build-all | |
- name: Deploy to Cloudflare | |
uses: cloudflare/pages-action@1 | |
with: | |
apiToken: ${{ secrets.CI_CF_PAGES }} | |
accountId: ${{ secrets.CF_ACCOUNT_ID }} | |
projectName: ${{ env.PAGES_PROJECT_NAME }} | |
directory: dist-cf | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
wranglerVersion: '3' | |
- name: Setup Github Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: './dist-gh' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |