diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5448ee1..26accc0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,19 +1,44 @@ -name: Jekyll Deploy +name: Deploy Jekyll site to Pages + on: push: branches: [source] + +permissions: + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + jobs: - build_and_deploy: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v2 + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@5f19ec79cedfadb78ab837f95b87734d0003c899 # v1.173.0 with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - name: Build & Deploy to GitHub Pages - uses: helaili/jekyll-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} + ruby-version: '3.3' + bundle-cache: true + - name: Setup 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 + + 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@v4 diff --git a/README.md b/README.md index fd40745..e286bb1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # whiteglass-template -[![Jekyll Deploy](https://github.com/yous/whiteglass-template/workflows/Jekyll%20Deploy/badge.svg?branch=source)](https://github.com/yous/whiteglass-template/actions?query=workflow%3A%22Jekyll+Deploy%22+branch%3Asource) +[![Deploy Jekyll site to Pages](https://github.com/yous/whiteglass-template/workflows/Deploy%20Jekyll%20site%20to%20Pages/badge.svg?branch=source)](https://github.com/yous/whiteglass-template/actions?query=workflow%3A%22Deploy+Jekyll+site+to+Pages%22+branch%3Asource) Template site for [whiteglass](https://github.com/yous/whiteglass) theme. Click "Use this template" button to start.