Created
February 11, 2025 13:53
-
-
Save syakesaba/d0ac44f1a7b7fcf3e405e2ad1ba28b70 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Jekyll site | |
on: | |
push: | |
branches: ["master"] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- # https://github.com/actions/checkout | |
name: Checkout | |
uses: actions/checkout@v4 | |
- # https://github.com/actions/configure-pages | |
name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- # https://github.com/actions/jekyll-build-pages | |
name: Build | |
uses: actions/jekyll-build-pages@v1 | |
- # https://github.com/actions/upload-pages-artifact | |
name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
# will upload artifact.tar.gz as github-pages | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- # https://github.com/actions/deploy-pages | |
name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- # https://github.com/actions/download-artifact | |
name: Download a single artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: github-pages | |
path: ./_site | |
# will download github-pages as ./_site/artifact.tar (not tar.gz!) | |
- # untar artifact.tar | |
name: Untar artifact.tar and remove | |
working-directory: ./_site | |
run: | | |
tar xvf ./artifact.tar && rm ./artifact.tar | |
- # https://github.com/cloudflare/wrangler-action | |
name: Publish to Cloudflare Pages | |
id: cloudflare | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy ./_site --project-name=${{ secrets.CLOUDFLARE_PAGES_PROJECT_NAME }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment