diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index e267b8a..9ea9ea7 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -37,7 +37,7 @@ jobs: - name: "Setup PHP" uses: shivammathur/setup-php@v2 with: - php-version: 8.4} + php-version: 8.4 - name: "Update FanArt" run: | diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..345de56 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,56 @@ +name: Deploy PR previews + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed + +concurrency: preview-${{ github.ref }} + +jobs: + deploy-preview: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Checkout + uses: actions/checkout@v4 + + - name: "Setup PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: 8.4 + + - name: "Update FanArt" + run: | + php updateData.php + + - name: Setup Ruby + uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 + with: + ruby-version: '3.1' + bundler-cache: true + cache-version: 0 + + - name: Setup Pages + id: pages + uses: actions/configure-pages@v5 + + - name: Build with Jekyll + run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" + env: + JEKYLL_ENV: production + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + preview-branch: master + source-dir: ./_site/ + action: auto \ No newline at end of file