website/.github/workflows/deploybot.yml
Andrei Jiroh Halili 258953e465 ci(github-actions): 🔧 iron-out deploybot CI stuff [skip ci]
This involves repo synchorizing stuff, among other things

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>
2023-05-15 11:22:37 +00:00

98 lines
5.3 KiB
YAML

# Simple workflow for deploying static content to GitHub Pages
name: deploybaut
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: "*/30 */6 * * *"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# 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: "pages"
cancel-in-progress: false
jobs:
gh-pages:
if: github.event_name == "push" || "workflow_dispatch"
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4.6.0
with:
python-version: 3.10
cache: pip
- name: Install dependencies
uses: brettcannon/pip-secure-install@v1.0.0
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build
run: |
sudo apt-get install \
libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev \
--yes
FF_ENABLE_COMMIT_DATA=true FF_GENERATE_SOCIAL_CARDS=true mkdocs build --use-directory-urls
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './public'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
repo-sync:
name: Repository sync
runs-on: ubuntu-latest
if: github.event_name == "push" || "workflow_dispatch"
steps:
- name: Checkout repository with full history
uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: ${{secrets.MIRRORBOT_CI_SSH_KEY}}
ssh-known-host: |
github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshc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IMZvRd4EtM7R+IHVMWmDkVU3VLQTSwQDSAvW0t2Tkj60
- name: Setup Git user details
run: |
git config --global user.name "Recap Time Bot"
git config --global user.email "gitops@recaptime.eu.org"
git remote add lab ssh://git@mau.dev/ajhalili2006/tildeverse-web
git remote add hut ssh://git@git.sr.ht/~ajhalili2006/tildeweb
- name: configure ssh
run: |
echo ${{secrets.MIRRORBOT_CI_SSH_KEY}} >> ~/.ssh/ci-passwordless-key
chmod 600 ~/.ssh/ci-passwordless-key
eval $(ssh-agent) && ssh-add ~/.ssh/ci-passwordless-key
- name: sync against github mirror first
run: |
git merge lab/main --ff-only || git rebase lab/main || echo "bailed out due to merge conflicts" && exit 1
git push origin main
- name: mirror
run: |
# only mirror main branch in meanwhile
git push lab main --verbose -o ci.skip
git push hut main --verbose -o skip-ci