Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
fforres committed Nov 22, 2024
1 parent 799689d commit 5393048
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/publish-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy website

on:
workflow_run:
# Esto tiene q hacer match con los nombres de los workflows de tests
workflows: ["Lint and Typecheck"]
branches: [main, release]
types:
- completed

jobs:
publish:
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Publish website to Cloudflare Workers
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
env:
ENVIRONMENT: ${{ github.event.workflow_run.head_branch == 'release' && 'production' || github.event.workflow_run.head_branch == 'main' && 'staging' || 'dev' }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
steps:
- name: ⏳ Cloning repo
uses: actions/checkout@v4
with:
show-progress: false

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false

- name: ⬢ Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Build project
run: BUILD_ENV=${{ env.ENVIRONMENT }} pnpm run build:site

- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
packageManager: pnpm
workingDirectory: ./apps/site
command: deploy --env ${{ env.ENVIRONMENT }} --minify

0 comments on commit 5393048

Please sign in to comment.