Bump actions/upload-pages-artifact from 1 to 3 #121
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: Continuous Integration | |
on: | |
# We have deploy there | |
# push: | |
# branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: read | |
pull-requests: write | |
env: | |
PREVIEW_DOMAIN: gradle.github.io | |
PREVIEW_REPO: community-site-preview | |
PREVIEW_PATH: ${{ github.event.repository.name }}/pull/${{github.event.number}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: "true" | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: pip install -r .devcontainer/requirements.txt | |
- name: Build the docs | |
run: mkdocs build | |
- name: Deploy to PR preview | |
uses: peaceiris/actions-gh-pages@v4 | |
if: github.ref != 'refs/heads/main' | |
with: | |
deploy_key: ${{ secrets.PREVIEW_DEPLOYMENT_KEY }} | |
external_repository: gradle/${{ env.PREVIEW_REPO }} | |
publish_dir: ./_site | |
destination_dir: ${{ env.PREVIEW_PATH }} | |
- name: Update comment | |
uses: hasura/[email protected] | |
if: github.ref != 'refs/heads/main' | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
number: ${{ github.event.number }} | |
id: deploy-preview | |
message: > | |
A preview of ${{ github.event.after }} is uploaded and can be seen here: | |
✨ https://${{ env.PREVIEW_DOMAIN }}/${{ env.PREVIEW_REPO }}/${{ env.PREVIEW_PATH}}/ ✨ | |
Changes may take a few minutes to propagate. |