Skip to content

.github/workflows/update.yml #3950

.github/workflows/update.yml

.github/workflows/update.yml #3950

Workflow file for this run

on:
schedule:
- cron: '*/30 * * * *'
push:
branches:
- 'main'
pull_request:
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@v5
- uses: actions/checkout@v4
- run: sudo apt-get install -y gettext
- run: uv run generate.py # generates "index.html"
- run: mkdir -p build && cp index.* style.css build
- name: Deploy 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
clean: false
git-config-name: github-actions[bot]
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Deploy to subdirectory if pull request 🚀
if: github.event_name == 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
target-folder: ${{ github.ref_name }}
clean: false
git-config-name: github-actions[bot]
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Update PR description if pull request
if: github.event_name == 'pull_request'
uses: chabroA/[email protected]
with:
auth: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.event.repository.name }}
owner: ${{ github.repository_owner }}
pr: ${{ github.event.number }}
url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ github.ref_name }}/"
message: "📊 Dashboard preview 📊:"
- name: Debug index.html if pull request
if: github.event_name == 'pull_request'
run: |
curl -Lo index.html-public https://github.com/m-aciek/pydocs-translation-dashboard/raw/refs/heads/gh-pages/index.html
diff --color=always -u index.html-public index.html || :
cat index.html
- uses: actions/upload-artifact@v4
with:
name: build
path: build