diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a90e5f29..09d8de7d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,10 +39,15 @@ jobs: - name: Build with Middleman run: | mkdir -p __build - BUILD_OUTPUT="__build" bundle exec middleman build - - name: Upload result - uses: actions/upload-artifact@v4 - with: - name: build-${{ github.event.number }} - path: '__build/**/*' - retention-days: 30 + - name: Setup preview + env: + www_path: 'pr-${{ github.event.number }}' + run: | + mkdir -p __preview + git clone https://github.com/rspec/preview --depth 1 --branch main __preview + mkdir -p '__preview/${{ env.www_path }}' + cp -R __build/ '__preview/${{ env.www_path }}' + cd __preview/ + git add '${{ env.www_path }}/*' + git commit -m 'PR build ${{ github.event.number }} - ${{ github.job }}' + git push origin main