From 1c537b89c233e7c0bac9f1599b479f8bdfc86190 Mon Sep 17 00:00:00 2001 From: fergal connolly Date: Fri, 5 Jul 2024 12:54:08 +0100 Subject: [PATCH] update action --- .github/gatsby_deploy.yml | 50 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/.github/gatsby_deploy.yml b/.github/gatsby_deploy.yml index 2e4cbcb..3e7599d 100644 --- a/.github/gatsby_deploy.yml +++ b/.github/gatsby_deploy.yml @@ -1,13 +1,24 @@ -name: gatsbyDeploy +name: CI + +# Controls when the workflow will run on: push: - branches: [ main , Release-July-2024 ] pull_request: + branches: [ main, release/v7 ] + + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - build-and-deploy-pages: + build-runbook: runs-on: ubuntu-latest + permissions: + contents: write + env: + SITE_PREFIX: /curam-performance-tuning/ + + # Steps represent a sequence of tasks that will be executed as part of the job steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -17,12 +28,12 @@ jobs: with: python-version: 3.x - - name: Install dependencies and Prepare environment + - name: Prepare environment run: | node --version npm install -g markdownlint-cli npm install --legacy-peer-deps - # npm ci + #npm ci pip install --user linkchecker - name: Build docs @@ -35,24 +46,11 @@ jobs: docker run --rm -d --name gatsby -p 8888:80 -v $(pwd)/public:/usr/local/apache2/htdocs$SITE_PREFIX httpd:2.4 linkchecker http://$(hostname -f):8888$SITE_PREFIX --config=./linkcheckerrc - - - name: Deploy to GitHub Pages - # only deploy when pushing to main - if: ${{ github.event_name == 'push' && github.ref_name == 'Release-July-2024' }} - run: | - cd ./public - git init -b main - git config user.name ${{ github.actor }} - git config user.email ${{ github.actor }}@users.noreply.github.com - git add . - git commit -m "Deploy commit: ${{ github.sha }}" - git push -f https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git main:gh-pages - echo 'Finished deploying the site.' - # - name: Deploy Pages - # uses: peaceiris/actions-gh-pages@v3 - # if: ${{ github.ref == 'refs/heads/main' }} - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - # publish_dir: ./public - # publish_branch: gh-pages - # force_orphan: true \ No newline at end of file + - name: Deploy Pages + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/main' }} + with: + github_token: ${{ secrets.PERF_GIT_DEPLOY_GH_PAGES_TOKEN }} + publish_dir: ./public + publish_branch: gh-pages + force_orphan: true