Add website update GitHub action

This commit is contained in:
Marta Sienkiewicz 2026-01-16 20:02:24 +01:00
parent 78782b6d93
commit 6ec6b5c7b9
5 changed files with 120 additions and 0 deletions

1
.github/CODEOWNERS vendored Normal file
View file

@ -0,0 +1 @@
* @MartaSien

11
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"

16
.github/linters/.mega-linter.yml vendored Normal file
View file

@ -0,0 +1,16 @@
# Configuration file for MegaLinter
# See all available variables at https://megalinter.io/configuration/ and in linters documentation
# ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
ENABLE_LINTERS:
- PYTHON_BLACK
- PYTHON_RUFF
- CSS_STYLELINT
- HTML_HTMLHINT
- MARKDOWN_MARKDOWNLINT
- YAML_PRETTIER
MARKDOWN_FILTER_REGEX_EXCLUDE: '(LICENSE\.md|docs/NEWS\.md)'
MARKDOWN_MARKDOWN_LINK_CHECK_DISABLE_ERRORS: true
PRE_COMMANDS:
- command: R --slave -e 'install.packages(c("lintr"))'
cwd: "root"
PRINT_ALL_FILES: false

37
.github/workflows/megalinter.yml vendored Normal file
View file

@ -0,0 +1,37 @@
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.io
name: MegaLinter
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
MEGALINTER_CONFIG: .github/linters/.mega-linter.yml
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
megalinter:
name: MegaLinter
runs-on: ubuntu-latest
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
- name: MegaLinter
id: ml
# You can override MegaLinter flavor used to have faster performances
# More info at https://megalinter.io/flavors/
uses: oxsecurity/megalinter/flavors/python@v8.0.0
env:
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.PAT }}
# DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks

55
.github/workflows/update-website.yml vendored Normal file
View file

@ -0,0 +1,55 @@
# Simple workflow for deploying static content to GitHub Pages
name: Update website
on:
# Runs on pushes targeting the default branch
pull_request:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "update"
cancel-in-progress: false
jobs:
# Run Python script to fetch REST API info
update:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Push to protected branch
token: ${{ secrets.PAT }}
# Fetch all commits instead of a single, top one
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Generate files
run: python main.py
- name: Prepare deployment branch
run: |
git stash
git checkout gh-pages
git reset --hard origin/master
git stash pop
- name: Commit and push
uses: stefanzweifel/git-auto-commit-action@v7.1.0
with:
commit_message: Update website
push_options: --force
branch: gh-pages