diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d3391e34..aabe2e7e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,6 +10,7 @@ on: - main permissions: contents: write + pages: write env: # HOME required by Setup Git and Setup Go Steps HOME: ${{ github.workspace }} @@ -97,12 +98,18 @@ jobs: gem update --system 3.2.3 echo "Pull Request: $TRAVIS_PULL_REQUEST" # Ensure the site builds, otherwise fail the build on PRs - if [[ $CI_NODE_INDEX = "build" && $TRAVIS_PULL_REQUEST != 'false' ]]; then bundle exec rake download_policy_list; bundle exec middleman build; fi + if [[ $CI_NODE_INDEX = "build" ]]; then bundle exec rake download_policy_list; bundle exec middleman build; fi # Ensure the links work, otherwise fail the build on PRs (only on PRs) if [[ $CI_NODE_INDEX = "check_links" && $TRAVIS_PULL_REQUEST != 'false' ]]; then echo "TODO Fix check_links to throttle itself properly"; fi - # Only deploy the site live if the master branch is updated (not during pull-requests) - # Currently, deploy first builds by default - if [[ $CI_NODE_INDEX = "build" && $TRAVIS_PULL_REQUEST == 'false' ]]; then bundle exec rake download_policy_list; bundle exec middleman deploy; fi + env: + CI_NODE_INDEX: ${{ matrix.index }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Deploy to Github Pages + if: ${{env.CI_NODE_INDEX == 'build' && github.ref == 'refs/heads/main'}} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build env: CI_NODE_INDEX: ${{ matrix.index }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/config.rb b/config.rb index 934434b0..a27e7036 100644 --- a/config.rb +++ b/config.rb @@ -270,7 +270,6 @@ def image(link, title, alt_text) # rsync, ftp, sftp, or git deploy.method = :git - end page "/release-feed.xml", :layout => false