Skip to content

Commit

Permalink
ci(workflow): add api production workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
susickypavel committed Oct 11, 2024
1 parent 94891ab commit c85b731
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 76 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: api@production

on:
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

- 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

- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
workingDirectory: apps/cloudflare
43 changes: 22 additions & 21 deletions .github/workflows/[email protected]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: web@production

on:
release:
types: [released]
push:
tags:
- "web@*"

env:
pnpm-version: 9
Expand Down Expand Up @@ -58,31 +59,31 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

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

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

- run: pnpm install
- run: pnpm install

- run: pnpm exec playwright install --with-deps chromium
working-directory: apps/web
- run: pnpm exec playwright install --with-deps chromium
working-directory: apps/web

- run: pnpm test
working-directory: apps/web
- run: pnpm test
working-directory: apps/web

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: apps/web/playwright-report/
retention-days: 7
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: apps/web/playwright-report/
retention-days: 7

deploy:
needs: [test]
Expand Down
2 changes: 1 addition & 1 deletion apps/cloudflare
Loading

0 comments on commit c85b731

Please sign in to comment.