Generate GitHub Pages #26
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: Generate GitHub Pages | |
on: | |
workflow_dispatch: | |
schedule: | |
# At 00:00 on every Tuesday UTC | |
- cron: '0 0 * * 2' | |
jobs: | |
generate-github-pages: | |
runs-on: ubuntu-latest | |
# Skip in forks | |
if: ${{ github.repository == 'element-hq/element-x-android' && ('pull_request' != github.event_name || github.event.pull_request.head.repo.full_name == github.repository) }} | |
steps: | |
- name: ⏬ Checkout with LFS | |
uses: nschloe/action-cached-lfs-checkout@v1.2.3 | |
- name: Use JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' # See 'Supported distributions' for available options | |
java-version: '21' | |
- name: Configure gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-read-only: ${{ github.ref != 'refs/heads/develop' }} | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Run World screenshots generation script | |
run: | | |
./tools/test/generateWorldScreenshots.py | |
mkdir -p screenshots/en | |
cp tests/uitests/src/test/snapshots/images/* screenshots/en | |
- name: Deploy GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./screenshots |