From df0eadbc1d26eee1ea207e97ce9af675bd3f500f Mon Sep 17 00:00:00 2001 From: katbow Date: Wed, 25 Sep 2024 15:18:59 +0100 Subject: [PATCH] Remove main.yml and unnecessary steps from gatsby.yml --- .github/workflows/gatsby.yml | 25 +++--------------- .github/workflows/main.yml | 50 ------------------------------------ 2 files changed, 3 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/gatsby.yml b/.github/workflows/gatsby.yml index 83a1573..6851b23 100644 --- a/.github/workflows/gatsby.yml +++ b/.github/workflows/gatsby.yml @@ -1,7 +1,3 @@ -# Sample workflow for building and deploying a Gatsby site to GitHub Pages -# -# To get started with Gatsby see: https://www.gatsbyjs.com/docs/quick-start/ -# name: Deploy Gatsby site to Pages on: @@ -36,26 +32,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Detect package manager - id: detect-package-manager - run: | - if [ -f "${{ github.workspace }}/yarn.lock" ]; then - echo "manager=yarn" >> $GITHUB_OUTPUT - echo "command=install" >> $GITHUB_OUTPUT - exit 0 - elif [ -f "${{ github.workspace }}/package.json" ]; then - echo "manager=npm" >> $GITHUB_OUTPUT - echo "command=ci" >> $GITHUB_OUTPUT - exit 0 - else - echo "Unable to determine package manager" - exit 1 - fi - name: Setup Node uses: actions/setup-node@v4 with: node-version: "20" - cache: ${{ steps.detect-package-manager.outputs.manager }} + cache: npm - name: Setup Pages id: pages uses: actions/configure-pages@v5 @@ -74,11 +55,11 @@ jobs: restore-keys: | ${{ runner.os }}-gatsby-build- - name: Install dependencies - run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + run: npm ci - name: Build with Gatsby env: PREFIX_PATHS: 'true' - run: ${{ steps.detect-package-manager.outputs.manager }} run build + run: npm run build - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 4366075..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Build and Deploy - -on: - push: - branches: master - -jobs: - build: - name: Build gatsby site - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - - name: Install Project Dependencies - run: npm ci - - - name: Build & deploy - run: npm run build - deploy: - needs: build - - name: Deploy gatsby site - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source - - # Deploy to the github-pages environment - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - # Specify runner + deployment step - runs-on: ubuntu-latest - steps: - - name: Configure Pages - uses: actions/configure-pages@v4 - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: my-artifact - path: src/ - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action