diff --git a/.github/workflows/deploy-admin.yml b/.github/workflows/deploy-admin.yml new file mode 100644 index 0000000..4c1f691 --- /dev/null +++ b/.github/workflows/deploy-admin.yml @@ -0,0 +1,59 @@ +name: Deploy Admin + +on: + push: + branches: [main] + paths: + - "apps/admin/**" + - "packages/shared-types/**" + - "packages/ui/**" + - ".github/workflows/deploy-admin.yml" + workflow_dispatch: + +concurrency: + group: deploy-admin-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build Admin + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.2 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build workspace + run: pnpm run build + + deploy: + name: Deploy Admin (Template) + runs-on: ubuntu-latest + needs: build + + steps: + - name: Trigger deployment webhook + env: + ADMIN_DEPLOY_WEBHOOK_URL: ${{ secrets.ADMIN_DEPLOY_WEBHOOK_URL }} + run: | + if [ -z "$ADMIN_DEPLOY_WEBHOOK_URL" ]; then + echo "ADMIN_DEPLOY_WEBHOOK_URL is not configured. Skipping deploy." + exit 0 + fi + + curl -X POST "$ADMIN_DEPLOY_WEBHOOK_URL" + echo "Admin deployment webhook triggered." diff --git a/.github/workflows/deploy-web.yml b/.github/workflows/deploy-web.yml new file mode 100644 index 0000000..a55a8be --- /dev/null +++ b/.github/workflows/deploy-web.yml @@ -0,0 +1,59 @@ +name: Deploy Web + +on: + push: + branches: [main] + paths: + - "apps/web/**" + - "packages/shared-types/**" + - "packages/ui/**" + - ".github/workflows/deploy-web.yml" + workflow_dispatch: + +concurrency: + group: deploy-web-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build Web + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.2 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build workspace + run: pnpm run build + + deploy: + name: Deploy Web (Template) + runs-on: ubuntu-latest + needs: build + + steps: + - name: Trigger deployment webhook + env: + WEB_DEPLOY_WEBHOOK_URL: ${{ secrets.WEB_DEPLOY_WEBHOOK_URL }} + run: | + if [ -z "$WEB_DEPLOY_WEBHOOK_URL" ]; then + echo "WEB_DEPLOY_WEBHOOK_URL is not configured. Skipping deploy." + exit 0 + fi + + curl -X POST "$WEB_DEPLOY_WEBHOOK_URL" + echo "Web deployment webhook triggered."