add deployment

This commit is contained in:
2025-03-27 21:55:17 +01:00
parent 2e9c91415d
commit 166d00f0e6
3 changed files with 61 additions and 0 deletions

53
.github/workflows/cloudflare_cd.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: Deploy Generation Heritage Svelte Kit App to Cloudflare
on:
workflow_call:
pull_request:
types: [closed]
paths:
- "apps/app**"
jobs:
ci:
uses: ./.github/workflows/svelte_ci.yml
deploy-to-production:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: ci
if: github.actor_id == 'vcscsvcscs' || ( github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true )
steps:
- uses: actions/checkout@v4
- name: Build & Deploy Worker to Production
uses: cloudflare/wrangler-action@v3
with:
environment: production
workingDirectory: 'apps/app'
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
secrets: |
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
env:
GOOGLE_CLIENT_ID: ${{ secrets.PROD_GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.PROD_GOOGLE_CLIENT_SECRET }}
deploy-to-stage:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: ci
if: github.actor_id == 'vcscsvcscs' || ( github.ref == 'refs/heads/stage' && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true )
steps:
- uses: actions/checkout@v4
- name: Build & Deploy Worker to Stage
uses: cloudflare/wrangler-action@v3
with:
environment: staging
workingDirectory: 'apps/app'
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
secrets: |
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
env:
GOOGLE_CLIENT_ID: ${{ secrets.STAGING_GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.STAGING_GOOGLE_CLIENT_SECRET }}

View File

@@ -1,7 +1,9 @@
name: Frontend Continuous Integration
on:
workflow_call:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "apps/app**"

View File

@@ -45,6 +45,9 @@
"staging": {
"name": "generations-heritage-stage",
"route": "https://ghstage.varghacsongor.hu/*",
"vars": {
"GOOGLE_CALLBACK_URI": "https://ghstage.varghacsongor.hu/login/google/callback"
},
"kv_namespaces": [
{
"binding": "GH_SESSIONS",
@@ -61,6 +64,9 @@
"production": {
"name": "generations-heritage-prod",
"route": "https://csalad.varghacsongor.hu/*",
"vars": {
"GOOGLE_CALLBACK_URI": "https://csalad.varghacsongor.hu/login/google/callback"
},
"kv_namespaces": [
{
"binding": "GH_SESSIONS",