Skip to content

Modern Docker Management, Designed for Everyone

ci/cd: merge two preview workflows

Kyle Mendell059197394e7b
diff --git a/.github/workflows/build-preview-website.yml b/.github/workflows/build-preview-website.yml
deleted file mode 100644
index 80b42c75e..000000000
--- a/.github/workflows/build-preview-website.yml
+++ /dev/null
@@ -1,38 +0,0 @@
-name: Build Preview Deployment
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
- cancel-in-progress: true
-
-on:
- pull_request:
- types: [opened, synchronize]
- paths:
- - 'docs/**'
-
-jobs:
- build-preview:
- runs-on: macos-latest
- defaults:
- run:
- working-directory: docs
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 22
- cache: npm
- cache-dependency-path: docs/package-lock.json
-
- - name: Install dependencies
- run: npm install
-
- - name: Build site
- run: npm run build
-
- - name: Upload build artifact
- uses: actions/upload-artifact@v4
- with:
- name: preview-build
- path: docs/build
- include-hidden-files: true
diff --git a/.github/workflows/deploy-preview-website.yml b/.github/workflows/deploy-preview-website.yml
index 549c5360c..1d7da2728 100644
--- a/.github/workflows/deploy-preview-website.yml
+++ b/.github/workflows/deploy-preview-website.yml
@@ -1,30 +1,39 @@
-name: Upload Preview Deployment
+name: Build and Deploy Preview
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
+ cancel-in-progress: true
on:
- workflow_run:
- workflows: [Build Preview Deployment]
- types:
- - completed
+ pull_request:
+ types: [opened, synchronize]
+ paths:
+ - 'docs/**'
permissions:
- actions: read
- deployments: write
contents: read
+ deployments: write
pull-requests: write
jobs:
- deploy-preview:
+ build-and-deploy:
runs-on: macos-latest
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ defaults:
+ run:
+ working-directory: docs
steps:
- - name: Download build artifact
- uses: actions/download-artifact@v4
- id: preview-build-artifact
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
- name: preview-build
- path: build
- github-token: ${{ secrets.GITHUB_TOKEN }}
- run-id: ${{ github.event.workflow_run.id }}
+ node-version: 22
+ cache: npm
+ cache-dependency-path: docs/package-lock.json
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Build site
+ run: npm run build
- name: Deploy to Cloudflare Pages
uses: AdrianGonz97/refined-cf-pages-action@v1
@@ -34,4 +43,4 @@ jobs:
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: arcane
deploymentName: Preview
- directory: build
+ directory: docs/build