Skip to content

Commit

Permalink
ci(meta): add staging deploy setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tsa96 committed Jun 27, 2024
1 parent ccf73f2 commit af22509
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/backend_docker_image.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
name: Publish Backend Docker

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
tag:
description: The tag to use for the docker image
default: 'latest'
required: false
type: string
workflow_call:
inputs:
tag:
default: 'latest'
required: false
type: string
secrets:
GITHUB_TOKEN:
required: true

jobs:
build:
Expand Down Expand Up @@ -40,3 +56,4 @@ jobs:
registry: ghcr.io
workdir: .
dockerfile: ./prod/Dockerfile
tags: ${{ inputs.tag }}
22 changes: 20 additions & 2 deletions .github/workflows/frontend_cf_pages.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
name: Publish Frontend

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
project_name:
description: The project name to publish the pages to
default: frontend
required: false
type: string
workflow_call:
inputs:
project_name:
description: The project name to publish the pages to
required: true
type: string
secrets:
CLOUDFLARE_PAGES_API_TOKEN:
required: true
CLOUDFLARE_ACCOUNT_ID:
required: true

jobs:
publish:
Expand Down Expand Up @@ -38,5 +56,5 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: website
projectName: ${{ inputs.project_name }}
directory: dist/apps/frontend
17 changes: 17 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish Staging

on:
push:
branches:
- main

jobs:
publish_frontend:
uses: momentum-mod/website/.github/workflows/frontend_cf_pages.yml@main
with:
project_name: 'frontend-staging'
secrets: inherit

publish_backend:
uses: momentum-mod/website/.github/workflows/backend_docker_image.yml@main
secrets: inherit

0 comments on commit af22509

Please sign in to comment.