From 5358cccffd30f75b99d350a8357a3184676b3644 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Sat, 18 May 2024 16:48:49 -0700 Subject: [PATCH] Use our own script to do documentation deployment Because the default branch is called main in both AMReX-Codes.github.io and amrex-tutorials, there is a name conflict in our previous setup using JamesIves/github-pages-deploy-action. So we switch to our script. --- .github/workflows/docs.yml | 49 +++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2083c794..235e87ef 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,5 +1,10 @@ name: Build and Deploy on: [push, pull_request] + +concurrency: + group: ${{ github.ref }}-${{ github.head_ref }}-docs + cancel-in-progress: true + jobs: build-and-deploy: runs-on: ubuntu-latest @@ -26,11 +31,39 @@ jobs: - name: Deploy if: github.event_name == 'push' && github.repository == 'AMReX-Codes/amrex-tutorials' && github.ref == 'refs/heads/main' - uses: JamesIves/github-pages-deploy-action@v4 - with: - ssh-key: ${{ secrets.DEPLOY_KEY }} - repository-name: AMReX-Codes/AMReX-Codes.github.io - branch: main # The branch the action should deploy to. - folder: Docs/build/html # The folder the action should deploy. - target_folder: amrex/tutorials_html # The folder the action should deploy to. - clean: false # Do not remove existing files from the deploy target. + env: + SSH_KEY: ${{ secrets.DEPLOY_KEY }} + run: | + # https://blog.benoitblanchon.fr/github-action-run-ssh-commands/ + echo "Configure SSH" + mkdir -p ~/.ssh/ + echo "$SSH_KEY" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + cat >>~/.ssh/config <