-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update deployment scripts (#638)
Co-authored-by: Davis SHYAKA <87414827+davis-shyaka@users.noreply.github.com> Co-authored-by: AdrianGonz97 <31664583+AdrianGonz97@users.noreply.github.com>
- Loading branch information
1 parent
af20bb9
commit 7539bf5
Showing
4 changed files
with
74 additions
and
6 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,33 @@ | ||
name: Build Preview Deployment | ||
|
||
# cancel in-progress runs on new commits to same PR (github.event.number) | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
build-preview: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build site | ||
run: pnpm build | ||
|
||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: preview-build | ||
path: sites/docs/.svelte-kit/cloudflare |
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,37 @@ | ||
name: Upload Preview Deployment | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Build Preview Deployment] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
actions: read | ||
deployments: write | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
deploy-preview: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Download build artifact | ||
uses: actions/download-artifact@v4 | ||
id: preview-build-artifact | ||
with: | ||
name: preview-build | ||
path: build | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
|
||
- name: Deploy to Cloudflare Pages | ||
uses: AdrianGonz97/refined-cf-pages-action@v1 | ||
with: | ||
apiToken: ${{ secrets.CF_API_TOKEN }} | ||
accountId: ${{ secrets.CF_ACCOUNT_ID }} | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
projectName: bits-ui | ||
deploymentName: Preview | ||
directory: ${{ steps.preview-build-artifact.outputs.download-path }} |
9 changes: 3 additions & 6 deletions
9
.github/workflows/docs-production.yml → .github/workflows/deploy-prod.yml
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
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