2023-10-27 14:25:21 +03:00
|
|
|
name: Docs
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2024-03-07 12:13:50 +03:00
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
2023-10-27 14:25:21 +03:00
|
|
|
workflow_dispatch:
|
|
|
|
|
2023-10-30 17:08:52 +03:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: pages
|
|
|
|
cancel-in-progress: false
|
|
|
|
|
2023-10-27 14:25:21 +03:00
|
|
|
jobs:
|
2023-10-30 17:08:52 +03:00
|
|
|
build:
|
2023-10-27 14:25:21 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-11-29 20:31:18 +03:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: ./.github/actions/init
|
2023-10-30 17:08:52 +03:00
|
|
|
- name: Setup Pages
|
|
|
|
uses: actions/configure-pages@v3
|
2023-10-27 14:25:21 +03:00
|
|
|
- name: Build
|
2024-04-14 04:49:44 +03:00
|
|
|
env:
|
|
|
|
BUILD_FOR_DOCS: 1
|
2024-03-07 12:13:50 +03:00
|
|
|
run: pnpm run -r --workspace-concurrency=1 build
|
2023-10-27 14:25:21 +03:00
|
|
|
- name: Build docs
|
|
|
|
run: |
|
|
|
|
pnpm run docs
|
|
|
|
touch docs/.nojekyll
|
|
|
|
echo "ref.mtcute.dev" > docs/CNAME
|
2023-10-30 17:08:52 +03:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-pages-artifact@v2
|
2023-10-27 14:25:21 +03:00
|
|
|
with:
|
2023-10-30 17:08:52 +03:00
|
|
|
path: docs
|
|
|
|
|
|
|
|
# Deployment job
|
|
|
|
deploy:
|
2024-03-15 00:25:37 +03:00
|
|
|
# only run on releases
|
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.actor == 'mtcute-bot'
|
2023-10-30 17:08:52 +03:00
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Deploy
|
|
|
|
steps:
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v2
|