name: Build and Deploy Jekyll site on: push: branches: [ main, master ] pull_request: branches: [ main, master ] workflow_dispatch: jobs: build: runs-on: ubuntu-latest defaults: run: working-directory: website steps: - uses: actions/checkout@v3 - name: Setup Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.0' bundler-cache: true working-directory: website - name: Install dependencies run: | bundle install - name: Build site run: bundle exec jekyll build - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: ./website/_site deploy: needs: build if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' # Grant GITHUB_TOKEN the permissions required to make a Pages deployment permissions: pages: write # to deploy to Pages id-token: write # to verify the deployment originates from an appropriate source # Deploy to the github-pages environment environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2