-
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
82bc3b6
commit ead6b20
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
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,56 @@ | ||
# Build and deploy the Docs Next.js site to GitHub Pages. | ||
name: Docs-Deploy | ||
|
||
on: | ||
# Allows you to run this workflow manually from the Actions tab. | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow adding deployments. | ||
permissions: | ||
contents: read | ||
deployments: write | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: Setup Node | ||
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 | ||
with: | ||
node-version: "20" | ||
cache: npm | ||
cache-dependency-path: docs/package-lock.json | ||
- name: Restore cache | ||
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3 | ||
with: | ||
path: | | ||
docs/.next/cache | ||
# Generate a new cache whenever packages or source files change. | ||
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | ||
# If source files changed but packages didn't, rebuild from a prior cache. | ||
restore-keys: | | ||
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | ||
- name: Install dependencies | ||
working-directory: docs | ||
run: npm install | ||
- name: Build with @cloudflare/next-on-pages | ||
working-directory: docs | ||
run: npm run pages:build | ||
- name: Publish to Cloudflare Pages | ||
uses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca # v1.5.0 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: 1d5774127406cf39ef881ff8d84f83c7 | ||
projectName: kubeconfig-lib | ||
directory: .vercel/output/static | ||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | ||
id: publish | ||
- name: Outputs | ||
run: | | ||
echo "ID: ${{ steps.publish.outputs.id }}" | ||
echo "URL: ${{ steps.publish.outputs.url }}" | ||
echo "Environment: ${{ steps.publish.outputs.environment }}" | ||
echo "Alias: ${{ steps.publish.outputs.alias }}" |