From beea97613e2b3a156d424c59e0c7bd84d86f85cb Mon Sep 17 00:00:00 2001 From: neelbrahmakshatriya Date: Wed, 5 Jun 2024 19:41:56 +0530 Subject: [PATCH] wip --- .github/workflows/deploy-demos.yml | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/deploy-demos.yml diff --git a/.github/workflows/deploy-demos.yml b/.github/workflows/deploy-demos.yml new file mode 100644 index 000000000..3fcd257d5 --- /dev/null +++ b/.github/workflows/deploy-demos.yml @@ -0,0 +1,50 @@ +name: Deploy - Demos +run-name: 🚀 Deploy - Demos + +on: workflow_dispatch + +jobs: + deployment: + runs-on: ubuntu-latest + env: + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + steps: + - name: ⚙️ Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 8 + + - name: ⚙️ Set BRAND_NAME environment variable from repo name + run: echo BRAND_NAME=${{ github.event.repository.name }} | cut -d '-' -f1 >> $GITHUB_ENV + + - name: ⬇️ Checkout template + uses: actions/checkout@v4 + with: + path: ${{ env.BRAND_NAME }}/nextjs-mui-free + + - name: ⬇️ Checkout scripts + uses: actions/checkout@v4 + with: + repository: themeselection/automation-scripts + token: ${{ secrets.GH_PAT }} + path: automation-scripts + + - name: ⬇️ Install packages in automation-scripts dir + working-directory: automation-scripts/nextjs + run: pnpm i + + - name: ⬇️ Install packages in typescript version + working-directory: ${{ env.BRAND_NAME }}/nextjs-mui-free/typescript-version + run: pnpm i + + - name: ⬇️ Install netlify CLI + working-directory: ${{ env.BRAND_NAME }}/nextjs-mui-free/typescript-version + run: pnpm i -D netlify-cli + + - name: 🔌 Connect to Netlify Site + run: netlify link + + - name: 🚀 Build & Deploy + working-directory: ${{ env.BRAND_NAME }}/nextjs-mui-free/typescript-version + run: pnpm netlify deploy --dir .next --prod --build