From 2eb6820da86322f0be4ef633d3c812e5e9d3cb1d Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 28 Feb 2025 11:45:59 +1100 Subject: [PATCH] Swapping v1 and v2 sites --- .../workflows/{pages.yml => pages-deploy.yml} | 4 +-- .github/workflows/pages-mirror.yml | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) rename .github/workflows/{pages.yml => pages-deploy.yml} (92%) create mode 100644 .github/workflows/pages-mirror.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages-deploy.yml similarity index 92% rename from .github/workflows/pages.yml rename to .github/workflows/pages-deploy.yml index 4bf6c41..f985548 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages-deploy.yml @@ -1,9 +1,9 @@ -name: Build and deploy the dev website to Github Pages +name: Deploy from the mirror on: # Runs on pushes targeting the docs branch push: - branches: ["v1-docs"] + branches: ["mirror"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/pages-mirror.yml b/.github/workflows/pages-mirror.yml new file mode 100644 index 0000000..7c0b1c1 --- /dev/null +++ b/.github/workflows/pages-mirror.yml @@ -0,0 +1,26 @@ +name: Send to the pages mirror + +on: + push: + branches: ["v1-docs"] + workflow_dispatch: + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Making secret key file + run: touch ~/mirror_secret + - name: Protecting secret key file + run: chmod 600 ~/mirror_secret + - name: Writing key to secret key file + run: echo '${{ secrets.MIRROR_SECRET }}' >> ~/mirror_secret + - name: Tweaking git to use the secret key file + run: git config --add --local core.sshCommand 'ssh -i ~/mirror_secret' + - name: Adding git remote + run: git remote add mirror ${{ secrets.MIRROR_ADDRESS }} + - name: Renaming git branch + run: git branch -m mirror + - name: Pushing to git remote + run: git push -f mirror \ No newline at end of file