generated from satnaing/astro-paper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bc1c7f
commit 9be405d
Showing
4 changed files
with
83 additions
and
100 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: "⚙️ Build and Upload Artifact Reusable Workflow" | ||
on: | ||
workflow_call: # Reusable workflow | ||
inputs: | ||
upload_artifact: | ||
type: boolean | ||
required: false | ||
description: "Whether to upload build artifact. Used in the deploy job." | ||
jobs: | ||
build: | ||
name: "⚙️ Build" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 3 | ||
permissions: | ||
contents: read | ||
env: | ||
NODE_VERSION: 18.x | ||
steps: | ||
- name: "☁️ Checkout repository" | ||
uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
name: "🔧 Setup pnpm" | ||
with: | ||
version: 8 | ||
run_install: false | ||
- name: "🔧 Setup Node.js ${{ env.NODE_VERSION }}" | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: pnpm | ||
cache-dependency-path: pnpm-lock.yaml | ||
- name: "📦 Install dependencies" | ||
run: pnpm install | ||
- name: "🔎 Lint code" | ||
run: pnpm run lint | ||
- name: "📝 Checking code format" | ||
run: pnpm run format:check | ||
- name: "⚙️ Build the project" | ||
run: pnpm run build | ||
- name: "📦 Upload build artifact" | ||
if: ${{ inputs.upload_artifact }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-artifact | ||
path: ./dist |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,9 @@ | ||
name: CI | ||
|
||
name: "⚙️ PR Build" | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
name: Code standards & build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 3 | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
|
||
steps: | ||
- name: "☁️ Checkout repository" | ||
uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v4 | ||
name: "🔧 Setup pnpm" | ||
with: | ||
version: 8 | ||
run_install: false | ||
|
||
- name: "🔧 Setup Node.js ${{ matrix.node-version }}" | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: pnpm | ||
cache-dependency-path: pnpm-lock.yaml | ||
|
||
- name: "📦 Install dependencies" | ||
run: pnpm install | ||
|
||
- name: "🔎 Lint code" | ||
run: pnpm run lint | ||
|
||
- name: "📝 Checking code format" | ||
run: pnpm run format:check | ||
|
||
- name: "🚀 Build the project" | ||
run: pnpm run build | ||
name: "⚙️ Build" | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
upload_artifact: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: "🚀 Deploy to Cloudflare Pages" | ||
on: | ||
push: | ||
branches: ["main"] | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref || github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
jobs: | ||
build: | ||
name: "⚙️ Build" | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
upload_artifact: true | ||
deploy: | ||
name: "🚀 Deploy to Cloudflare Pages" | ||
runs-on: ubuntu-latest | ||
needs: build | ||
permissions: | ||
contents: read | ||
deployments: write | ||
steps: | ||
- name: "☁️ Download build artifact" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: build-artifact | ||
- name: "🚀 Publish" | ||
uses: cloudflare/pages-action@v1 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
projectName: pogor-dev | ||
directory: ./ | ||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} |