Skip to content

Commit

Permalink
Use actions-gh-pages workflow to deploy to GitHub Pages by Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
yasulab committed Jan 11, 2025
1 parent bd5ee7a commit 49c40dd
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
bundle exec rake upsert_data_by_readme
bundle exec rake test
- name: πŸš€ Deploy
- name: πŸ€– Generate page(s) by README
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
cd ./docs
Expand All @@ -50,3 +50,31 @@ jobs:
git commit -m 'πŸ€– Generate page(s) by README'
git push origin main
fi
# 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: |
cd ./docs
bundle install
- 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

0 comments on commit 49c40dd

Please sign in to comment.