mirror of
https://github.com/vcscsvcscs/GenerationsHeritage.git
synced 2025-08-12 13:59:08 +02:00
add deployment
This commit is contained in:
53
.github/workflows/cloudflare_cd.yml
vendored
Normal file
53
.github/workflows/cloudflare_cd.yml
vendored
Normal 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 }}
|
2
.github/workflows/svelte_ci.yml
vendored
2
.github/workflows/svelte_ci.yml
vendored
@@ -1,7 +1,9 @@
|
||||
name: Frontend Continuous Integration
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- "apps/app**"
|
||||
|
||||
|
@@ -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",
|
||||
|
Reference in New Issue
Block a user