Skip to content

๐Ÿ’š Pages Function ใงใƒ‡ใƒ—ใƒญใ‚คใงใใ‚‹ใ‚ˆใ†ใซ #62

๐Ÿ’š Pages Function ใงใƒ‡ใƒ—ใƒญใ‚คใงใใ‚‹ใ‚ˆใ†ใซ

๐Ÿ’š Pages Function ใงใƒ‡ใƒ—ใƒญใ‚คใงใใ‚‹ใ‚ˆใ†ใซ #62

Workflow file for this run

name: cloudflare
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, '[skip ci]') == false
steps:
- name: ๐Ÿ“ฅ Checkout repository
uses: actions/checkout@v3
- name: ๐Ÿ“ธ Calculate commit hash
id: sha
uses: pr-mpt/actions-commit-hash@v2
- name: ๐Ÿ”จ Prepare Node environment
uses: actions/setup-node@v4
with:
node-version: 22
- name: ๐ŸŽ‰ Install project dependencies
run: yarn install
- name: ๐Ÿ—๏ธ Build app
run: yarn run build
env:
VITE_ESA_APP_CLIENT_ID: ${{ secrets.ESA_APP_CLIENT_ID }}
VITE_ESA_APP_REDIRECT_URI: ${{ secrets.ESA_APP_REDIRECT_URI }}
- name: ๐Ÿš€ Deploy to Cloudflare Pages
id: cloudflare_pages_deploy
uses: cloudflare/wrangler-action@2.0.0
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: "pages deploy ./dist --project-name esachievement"
secrets: |
CLIENT_ID
SECRET_CLIENT_ID
REDIRECT_URI
env:
NODE_VERSION: 22
ESA_APP_CLIENT_ID: ${{ secrets.ESA_APP_CLIENT_ID }}
ESA_APP_CLIENT_SECRET: ${{ secrets.ESA_APP_CLIENT_SECRET }}
ESA_APP_REDIRECT_URI: ${{ secrets.ESA_APP_REDIRECT_URI }}
- name: ๐Ÿš€ Deploy pages based on commit sha
uses: actions/github-script@v6
with:
script: |
const sha = context.payload.pull_request?.head.sha ?? context.sha;
await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
context: "cloudflare / build (push)",
description: "Commit based deploy",
state: "success",
sha,
target_url: "esachievement.pages.dev",
});