Skip to content

Commit faba98e

Browse files
committed
feat: add GitHub Actions workflow for deploying AtlasOS website to Cloudflare Workers, including setup for Bun, caching, and deployment steps
1 parent 9e9dba4 commit faba98e

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Deploy AtlasOS website to Cloudflare Workers
2+
# Secrets: CLOUDFLARE_API_TOKEN (required), CLOUDFLARE_ACCOUNT_ID (optional, for faster auth)
3+
# https://developers.cloudflare.com/fundamentals/api/get-started/create-token/
4+
5+
name: Deploy to Cloudflare Workers
6+
7+
on:
8+
push:
9+
branches: [main, feat/native-docs]
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: deploy-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
deploy:
18+
name: Build & Deploy
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 15
21+
permissions:
22+
contents: read
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Bun
29+
uses: oven-sh/setup-bun@v2
30+
with:
31+
bun-version: latest
32+
33+
- name: Cache dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: ~/.bun/install/cache
37+
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock', 'bun.lockb') }}
38+
restore-keys: bun-${{ runner.os }}-
39+
40+
- name: Install dependencies
41+
run: bun install --frozen-lockfile
42+
43+
- name: Build
44+
run: bun run build
45+
46+
- name: Deploy to Cloudflare Workers
47+
id: deploy
48+
uses: cloudflare/wrangler-action@v3
49+
with:
50+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
51+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
52+
command: deploy
53+
54+
- name: Deployment summary
55+
if: success()
56+
env:
57+
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }}
58+
run: |
59+
echo "## Deployment complete" >> $GITHUB_STEP_SUMMARY
60+
echo "" >> $GITHUB_STEP_SUMMARY
61+
echo "**Worker:** atlasos-website" >> $GITHUB_STEP_SUMMARY
62+
echo "**Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
63+
[ -n "$DEPLOYMENT_URL" ] && echo "**URL:** $DEPLOYMENT_URL" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)