From a01651281390e27ffb4d04c844b9204c5af234e9 Mon Sep 17 00:00:00 2001 From: Per Unneberg Date: Wed, 15 Nov 2023 10:00:03 +0100 Subject: [PATCH 1/3] Test variable substitution --- .github/workflows/build.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8012fa67..8aae11c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,13 +100,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create archive branch - if: startsWith(github.ref, 'refs/tags/v') + #if: startsWith(github.ref, 'refs/tags/v') run: | - if git show-ref --quiet "refs/heads/archive-${{ github.refname }}"; then - echo "archive-${{ github.refname }}" branch exists - else - git branch "archive-${{ github.refname }}" gh-pages - fi + echo "Creating archive branch archive-${{ github.refname }}" + #if git show-ref --quiet "refs/heads/archive-${{ github.refname }}"; then + # echo "archive-${{ github.refname }}" branch exists + #else + # git branch "archive-${{ github.refname }}" gh-pages + #fi - name: Render tag and save rendered state in separate branch uses: quarto-dev/quarto-actions/publish@v2 From c76ed4c2f15d1236cfd797e7384127f7178c9986 Mon Sep 17 00:00:00 2001 From: Per Unneberg Date: Wed, 15 Nov 2023 10:15:05 +0100 Subject: [PATCH 2/3] Change refname to ref_name --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8aae11c5..c8e1340d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,20 +100,20 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create archive branch - #if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') run: | - echo "Creating archive branch archive-${{ github.refname }}" - #if git show-ref --quiet "refs/heads/archive-${{ github.refname }}"; then - # echo "archive-${{ github.refname }}" branch exists - #else - # git branch "archive-${{ github.refname }}" gh-pages - #fi + echo "Creating archive branch archive-${{ github.ref_name }}" + if git show-ref --quiet "refs/heads/archive-${{ github.ref_name }}"; then + echo "archive-${{ github.ref_name }}" branch exists + else + git branch "archive-${{ github.ref_name }}" gh-pages + fi - name: Render tag and save rendered state in separate branch uses: quarto-dev/quarto-actions/publish@v2 if: startsWith(github.ref, 'refs/tags/v') with: - target: "archive-${{ github.refname }}" + target: "archive-${{ github.ref_name }}" path: docs env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ff8bd99d37465b7cfe12d458f4462525f79b42bb Mon Sep 17 00:00:00 2001 From: Per Unneberg Date: Wed, 15 Nov 2023 10:56:01 +0100 Subject: [PATCH 3/3] Checkout correct archive branch name --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8e1340d..dbb6bc59 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -143,7 +143,7 @@ jobs: echo "Directory ${tag} already exsists. Removing" git rm -f $tag fi - git clone --depth 1 --branch $tag "https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" $tag + git clone --depth 1 --branch "archive-$tag" "https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" $tag git add -f $tag contents=$(git tag -n 100 $tag --format "%(contents)") echo "
" >> index.html