diff --git a/.github/workflows/blob-storage-website-ci.yml b/.github/workflows/blob-storage-website-ci.yml deleted file mode 100644 index 40ed5d0..0000000 --- a/.github/workflows/blob-storage-website-ci.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Deploy Next.js site to Azure Blob Storage - -on: - # Runs on pushes targeting the default branch - push: - # branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Set working directory -defaults: - run: - working-directory: ./docs - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Build job - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Bun - uses: oven-sh/setup-bun@v1 - - name: Install dependencies - run: bun install - - name: Build with Next.js - run: bun run build - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - path: ./docs/out - - # Deployment job - deploy: - runs-on: ubuntu-latest - needs: build - - env: - AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP}} - CLIENT_ID: ${{ secrets.CLIENT_ID }} - TENANT_ID: ${{ secrets.TENANT_ID }} - SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }} - - steps: - - name: Login to Azure - uses: azure/login@v1 - with: - client-id: ${{ env.CLIENT_ID }} - tenant-id: ${{ env.TENANT_ID }} - subscription-id: ${{ env.SUBSCRIPTION_ID }} diff --git a/.github/workflows/build-static-site.yml b/.github/workflows/build-static-site.yml new file mode 100644 index 0000000..daba7ac --- /dev/null +++ b/.github/workflows/build-static-site.yml @@ -0,0 +1,31 @@ +name: Build Next.js static site + +on: workflow_call + +# Sets permissions of the GITHUB_TOKEN +permissions: + contents: read + checks: write + id-token: write + +# Set working directory +defaults: + run: + working-directory: ./docs + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + - name: Install dependencies + run: bun install + - name: Build with Next.js + run: bun run build + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + path: ./docs/out diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index d840893..6cd55c8 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -2,10 +2,10 @@ name: CICD Pipeline on: push: - branches: ["main"] + # branches: ["main"] paths-ignore: - .gitignore - - "docs/**" + # - "docs/**" workflow_dispatch: @@ -21,4 +21,10 @@ jobs: with: environment: prod secrets: inherit + + build-prod: + uses: ./.github/workflows/build-static-site.yml + with: + environment: prod + secrets: inherit \ No newline at end of file