Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dev-deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: note
---

Added a new workflow that automatically previews dev on [dev.sable.moe](https://dev.sable.moe)
8 changes: 7 additions & 1 deletion .github/scripts/enrich-changelog.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,13 @@ async function updateReleasePullRequest(token, owner, repo, contributorCache, dr
}

const releasePr = openPulls[0];
const enrichedBody = await enrichText(token, owner, repo, releasePr.body ?? '', contributorCache);
let enrichedBody = await enrichText(token, owner, repo, releasePr.body ?? '', contributorCache);

const devLinkMessage =
'> **Preview the next release on [dev.sable.moe](https://dev.sable.moe)**\n\n';
if (!enrichedBody.includes('dev.sable.moe')) {
enrichedBody = devLinkMessage + enrichedBody;
}

if (dryRun) {
console.log('--- release PR body (dry run) ---\n');
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/cloudflare-web-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Cloudflare Infra (Dev)

on:
push:
branches:
- dev
workflow_dispatch:

env:
CLOUDFLARE_API_TOKEN: ${{ secrets.TF_CLOUDFLARE_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TF_VAR_workers_message: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || github.ref_name }}
TF_VAR_account_id: ${{ secrets.TF_VAR_ACCOUNT_ID }}
TF_VAR_zone_id: ${{ secrets.TF_VAR_ZONE_ID }}
TF_VAR_custom_domain: 'dev.sable.moe'
TF_VAR_worker_name: 'sable-dev'
TF_HTTP_ADDRESS: ${{ secrets.TF_HTTP_ADDRESS_DEV }}
TF_HTTP_LOCK_ADDRESS: ${{ secrets.TF_HTTP_LOCK_ADDRESS_DEV }}
TF_HTTP_UNLOCK_ADDRESS: ${{ secrets.TF_HTTP_UNLOCK_ADDRESS_DEV }}
TF_HTTP_USERNAME: ${{ secrets.TF_HTTP_USERNAME }}
TF_HTTP_PASSWORD: ${{ secrets.TF_HTTP_PASSWORD }}
TF_HTTP_LOCK_METHOD: 'POST'
TF_HTTP_UNLOCK_METHOD: 'DELETE'
TF_HTTP_RETRY_WAIT_MIN: '5'

concurrency:
group: cloudflare-infra-dev
cancel-in-progress: false

jobs:
apply:
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: infra/web
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Prepare OpenTofu deployment
uses: ./.github/actions/prepare-tofu
with:
is_release_tag: 'false'
env:
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
VITE_SENTRY_ENVIRONMENT: development
VITE_APP_VERSION: ${{ github.ref_name }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}

- name: Plan infrastructure
run: tofu plan -input=false -no-color

- name: Apply infrastructure
run: tofu apply -input=false -auto-approve
2 changes: 1 addition & 1 deletion .github/workflows/cloudflare-web-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ concurrency:

jobs:
deploy:
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push'
if: (github.event.pull_request.head.repo.full_name == github.repository && github.head_ref != 'release') || github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
Loading