diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 000000000..e6f2d0bb5 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,31 @@ +on: + pull_request: + types: [opened, synchronize, reopened] +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: read + name: Deploy to Cloudflare Pages + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2.3' + bundler-cache: true + - name: Install Dependencies + run: bundle install + - name: Build Static Site + run: | + bundle exec jekyll build \ + --destination preview \ + --config _config.yml,_config_pages.yml + - name: Deploy + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy preview --project-name=rails-website-preview + gitHubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/_config_pages.yml b/_config_pages.yml new file mode 100644 index 000000000..17becdfab --- /dev/null +++ b/_config_pages.yml @@ -0,0 +1,2 @@ +exclude: + - vendor