diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a25bc17b..e3a49fd9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + - v* jobs: build-book: @@ -76,6 +77,7 @@ jobs: run: cd website && make - name: Deploy website index + if: github.ref == 'refs/heads/main' uses: JamesIves/github-pages-deploy-action@v4.6.1 with: folder: website @@ -95,6 +97,7 @@ jobs: # run: cd source && ninja python-book-pdf - name: Deploy Python book + if: github.ref == 'refs/heads/main' uses: JamesIves/github-pages-deploy-action@v4.6.1 with: folder: python-book @@ -113,6 +116,7 @@ jobs: # run: cd source && ninja python-book-pdf - name: Deploy R book + if: github.ref == 'refs/heads/main' uses: JamesIves/github-pages-deploy-action@v4.6.1 with: folder: r-book @@ -120,3 +124,24 @@ jobs: branch: main single-commit: true token: ${{ secrets.BOOK_UPLOAD_TOKEN }} + + # If we're building a set edition, such as v3, push all into + # same repo + + - name: Setup book edition for deployment + if: startsWith(github.ref, 'refs/heads/v') + run: | + cp -r r-book website + cp -r python-book website + + - name: Deploy book edition + if: startsWith(github.ref, 'refs/heads/v') + uses: JamesIves/github-pages-deploy-action@v4.6.1 + env: + TOKEN_NAME: BOOK_UPLOAD_TOKEN_${{ github.ref_name }} + with: + folder: website + repository-name: "resampling-stats/${{ github.ref_name }}" + branch: main + single-commit: true + token: ${{ secrets[env.TOKEN_NAME] }}