Skip to content

Commit

Permalink
ci(workflow) add cloudflare deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
susickypavel committed Oct 11, 2024
1 parent 47ea1ba commit baf8370
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: api@production

on:
workflow_dispatch:
push:
tags:
- "api@*"

env:
pnpm-version: 9
node-version: 20

jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.CLOUDFLARE_SUBMODULE }}

- uses: pnpm/action-setup@v4
with:
version: ${{ env.pnpm-version }}

- uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
cache: "pnpm"

- run: pnpm install -P

- run: pnpm build
working-directory: apps/cloudflare

deploy:
needs: [build]
runs-on: ubuntu-latest
environment:
name: api:production
url: https://cloudflare.frontendista.cz

steps:
- uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.CLOUDFLARE_SUBMODULE }}

- uses: pnpm/action-setup@v4
with:
version: ${{ env.pnpm-version }}

- uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
cache: "pnpm"

- name: Deploy
run: pnpm deploy:prod
env:
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}
CF_EMAIL: ${{ secrets.CF_EMAIL }}
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}

0 comments on commit baf8370

Please sign in to comment.