chore: update change #57
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: Cloudflare Pages | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
on: [push] | |
jobs: | |
yalc_check: | |
runs-on: ubuntu-latest | |
outputs: | |
can_deploy: ${{ steps.has_yalc.conclusion == 'success' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Yalc | |
run: npm i -g yalc | |
- id: has_yalc | |
run: | | |
! yalc check | grep -qe . | |
deploy: | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
needs: [yalc_check] | |
permissions: | |
contents: read | |
deployments: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Check Yalc | |
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' }} | |
run: if [ ${{ needs.yalc_check.outputs.can_deploy }} != true ]; then exit 1; else exit 0; fi | |
- uses: pnpm/[email protected] | |
with: | |
version: 7.8.0 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'pnpm' | |
- run: pnpm install --frozen-lockfile | |
- name: Build and Export | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: pnpm build && pnpm export | |
- name: Build and Export with Profiler | |
if: ${{ github.ref != 'refs/heads/main' }} | |
run: pnpm build --profile && pnpm export | |
- name: Generate sitemap | |
if: false | |
# if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
mkdir -p ./out/sitemaps | |
pnpm generate:sitemaps | |
- name: Publish | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: ens-app-v3 | |
directory: out | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Submit sitemap | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: curl https://www.google.com/ping\?sitemap=https://app.ens.domains/sitemap.xml |