-
Notifications
You must be signed in to change notification settings - Fork 8
126 lines (100 loc) · 3.41 KB
/
deploy.yml
File metadata and controls
126 lines (100 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Deploy site
on:
workflow_dispatch:
push:
branches: [master]
paths-ignore: ['docs/assets/keymap*.json', 'README.md']
jobs:
version:
runs-on: ubuntu-latest
outputs:
lxl: ${{ steps.version.outputs.lxl }}
keymap: ${{ steps.version.outputs.keymap }}
keymap_macos: ${{ steps.version.outputs.keymap_macos }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get versions
id: version
env: { GH_TOKEN: "${{ github.token }}" }
run: |
echo "lxl=$(gh -R lite-xl/lite-xl release list --exclude-drafts --exclude-pre-releases --limit 1 --json tagName --jq .[].tagName)" >> "$GITHUB_OUTPUT"
echo "keymap=$(jq -r .version docs/assets/keymap.json)" >> "$GITHUB_OUTPUT"
echo "keymap_macos=$(jq -r .version docs/assets/keymap-macos.json)" >> "$GITHUB_OUTPUT"
generate_keymap:
uses: ./.github/workflows/generate_keymap.yml
needs: version
secrets: inherit
permissions:
contents: write
pull-requests: write
with:
lite_xl_version: ${{ needs.version.outputs.lxl }}
skip: ${{ needs.version.outputs.lxl == needs.version.outputs.keymap && needs.version.outputs.lxl == needs.version.outputs.keymap_macos }}
build:
runs-on: ubuntu-latest
needs: [version, generate_keymap]
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Download updated keymaps
uses: actions/download-artifact@v7
with:
merge-multiple: true
path: docs/assets
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libcairo2-dev libfreetype-dev libffi-dev libjpeg-dev libpng-dev zlib1g-dev pngquant
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: "auto"
cache-dependency-glob: "uv.lock"
- name: Install Python
uses: actions/setup-python@v6
with:
python-version-file: pyproject.toml
- name: Install node.js
uses: actions/setup-node@v6
with:
node-version: latest
cache: npm
- name: Install node.js tools
run: npm ci
- name: Cache build data
uses: actions/cache@v5
with:
key: mkdocs-cache-${{ runner.os }}-${{ hashFiles('**/uv.lock', '**/package-lock.json', '**/mkdocs.yml') }}
path: .cache
- name: Setup environment variables
run: |
if [[ "${GITHUB_REPOSITORY}" = *.github.io ]]; then
echo "SITE_URL=https://${GITHUB_REPOSITORY%/*}.github.io/" >> $GITHUB_ENV
else
echo "SITE_URL=https://${GITHUB_REPOSITORY%/*}.github.io/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
fi
echo "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" >> $GITHUB_ENV
- name: Build
env:
CARDS: 'true'
LITE_XL_VERSION: ${{ needs.version.outputs.lxl }}
run: npm run build
- name: Upload page artifact
uses: actions/upload-pages-artifact@v4
with: { path: site }
deploy:
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4