diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll-publish.yml similarity index 71% rename from .github/workflows/jekyll.yml rename to .github/workflows/jekyll-publish.yml index 7be260c..52d36e0 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll-publish.yml @@ -1,10 +1,4 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Deploy Jekyll site to Pages +name: Deploy Jekyll site to Cloudflare Pages on: # Runs on pushes targeting the default branch @@ -41,6 +35,7 @@ jobs: ruby-version: '3.4.1' # Not needed with a .ruby-version file bundler-cache: true # runs 'bundle install' and caches installed gems automatically cache-version: 0 # Increment this number if you need to re-download cached gems + - name: Setup Pages id: pages uses: actions/configure-pages@v5 @@ -49,6 +44,7 @@ jobs: run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" env: JEKYLL_ENV: production + - name: Push image optimizations onto main continue-on-error: true run: | @@ -58,18 +54,11 @@ jobs: git add assets/img git commit -m "chore: optimize images" git push - - name: Upload artifact - # Automatically uploads an artifact from the './_site' directory by default - uses: actions/upload-pages-artifact@v3 + + - name: Publish to Cloudflare Pages + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy _site --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v5