Skip to content

Deploy to Cloudflare Pages #5

Deploy to Cloudflare Pages

Deploy to Cloudflare Pages #5

Workflow file for this run

name: Deploy to Cloudflare Pages
on:
workflow_dispatch:
concurrency:
group: 'prod-deploy'
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment: deploy
permissions:
contents: read
deployments: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Resolve version tag
id: get_version
run: |
git fetch --tags --force
VERSION_TAG=$(git tag --list "v*" --sort=-v:refname | head -n 1)
if [ -z "$VERSION_TAG" ]; then
VERSION_TAG="vX.X.X"
fi
VERSION_NO_V=${VERSION_TAG#v}
echo "VERSION_NO_V=${VERSION_NO_V}" >> "$GITHUB_ENV"
echo "Resolved version tag: $VERSION_TAG"
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Update version files
run: bun scripts/update-version.js ${{ env.VERSION_NO_V }}
- name: Build
run: bun run build
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy build --project-name=ramolibrelab --branch=main