Build and Publish all-blog-posts.xml #2177
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 and Publish all-blog-posts.xml | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '30 * * * *' # Run at :30 every hour | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.1' | |
| bundler-cache: false | |
| - name: Add Linux platform to Gemfile.lock | |
| run: bundle lock --add-platform x86_64-linux | |
| - name: Install dependencies | |
| run: bundle install | |
| - name: Build Jekyll site | |
| run: bundle exec jekyll build | |
| - name: Prepare deployment directory | |
| run: | | |
| mkdir -p ./deploy | |
| cp ./_site/all-blog-posts.xml ./deploy/ | |
| cp ./_site/new-blog-posts.xml ./deploy/ | |
| cp -r ./assets ./deploy/ | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./deploy | |
| publish_branch: gh-pages |