Skip to content

Commit

Permalink
refactor: combine deploy actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ny1am committed Jan 4, 2025
1 parent 824a914 commit b4d9843
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 47 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/deploy-dev.yml

This file was deleted.

30 changes: 17 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: deploy
on:
push:
branches: [main]
branches: [main, develop]
workflow_dispatch:

env:
PROD_FLAG: ${{ github.ref_name == 'main' && '--prod' || '' }}

jobs:
build:
uses: ./.github/workflows/build.yml
Expand All @@ -14,23 +17,24 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 8.14.1

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- run: pnpm install

- uses: actions/download-artifact@v3
with:
name: dist
path: apps/website/dist
- uses: netlify/actions/cli@master
with:
args: deploy --prod
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

- name: install netlify
run: npm install netlify-cli@17.10.1 -g

- name: deploy to netlify
id: netlify_deploy
run: |
netlify deploy \
--filter website \
--dir apps/website/dist \
--site ${{ secrets.NETLIFY_SITE_ID }} \
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
$PROD_FLAG

0 comments on commit b4d9843

Please sign in to comment.