From bfe33cc9fd8d5030f73d622ddd48e13fb097b364 Mon Sep 17 00:00:00 2001 From: Jared Smith Date: Sat, 30 May 2026 15:48:20 -0700 Subject: [PATCH] updating workflows --- .github/workflows/deploy.yml | 53 ++++++++++++++++++------------- .github/workflows/test-deploy.yml | 21 ++++++------ 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 26ac20a..2c23445 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,42 +1,51 @@ -name: deploy +name: Deploy to GitHub Pages on: push: branches: - main - workflow_dispatch: - -permissions: - contents: write + # Review gh actions docs if you want to further define triggers, paths, etc + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on jobs: - build-and-deploy: + build: + name: Build Docusaurus runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: node-version: 20 cache: npm - cache-dependency-path: AgML/package-lock.json - name: Install dependencies - working-directory: AgML run: npm ci - - - name: Build site - working-directory: AgML + - name: Build website run: npm run build - - name: Deploy to gh-pages - uses: peaceiris/actions-gh-pages@v4 + - name: Upload Build Artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: gh-pages - publish_dir: ./AgML/build \ No newline at end of file + path: build + + deploy: + name: Deploy to GitHub Pages + needs: build + + # 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 }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 2d9e5dc..1393d07 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -1,29 +1,26 @@ -name: test-deploy +name: Test deployment on: pull_request: branches: - main + # Review gh actions docs if you want to further define triggers, paths, etc + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on jobs: test-deploy: + name: Test deployment runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 with: node-version: 20 cache: npm - cache-dependency-path: AgML/package-lock.json - name: Install dependencies - working-directory: AgML run: npm ci - - - name: Build site - working-directory: AgML + - name: Test build website run: npm run build \ No newline at end of file