Exec: bundle update #117
This file contains 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: Test & Deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "*" | |
# Allows you to run this workflow manually from the Actions tab | |
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow | |
workflow_dispatch: | |
jobs: | |
# Test job is always triggered as continuous integration | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: ☑️ Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: 💎 Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: 🔧 Build & Test | |
run: | | |
JEKYLL_ENV=test bundle exec jekyll build | |
JEKYLL_ENV=test bundle exec jekyll doctor | |
SKIP_BUILD=true bundle exec rake test | |
# Deploy job is triggered only pushed to main branch && CI passed | |
deploy: | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: ☑️ Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: 💎 Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: 🧪 Install gems | |
run: | | |
bundle install | |
- name: 🔧 Build & Test | |
run: | | |
JEKYLL_ENV=production bundle exec jekyll build | |
JEKYLL_ENV=production bundle exec jekyll doctor | |
SKIP_BUILD=true bundle exec rake test | |
- name: 🚀 Deploy to GitHub Pages | |
if: github.ref == 'refs/heads/main' && job.status == 'success' | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
personal_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_site |