-
Notifications
You must be signed in to change notification settings - Fork 66
70 lines (64 loc) · 2.21 KB
/
deploy.yml
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
name: Deploy static content
defaults:
run:
shell: bash
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '2 0 * * *'
concurrency:
group: deploy-static-content
cancel-in-progress: true
jobs:
run:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Python dependencies
run: python -m pip install pywin32
- name: Clone last deployed content
run: |
git clone --branch pages --single-branch --depth 1 https://github.com/ramensoftware/windhawk-mods.git ${{ runner.temp }}/last_deploy
# Remove the .git directory which interferes with the pages deployment.
rm -rf ${{ runner.temp }}/last_deploy/.git
- name: Cache Windhawk
id: cache-windhawk
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/windhawk
key: v1-${{ runner.os }}-1.5.1
- name: Extract Windhawk
if: steps.cache-windhawk.outputs.cache-hit != 'true'
run: |
installer_url="https://github.com/ramensoftware/windhawk/releases/download/v1.5.1/windhawk_setup.exe"
installer_path="${{ runner.temp }}/windhawk_setup.exe"
echo "Downloading $installer_url to $installer_path"
curl -L "$installer_url" -o "$installer_path"
extract_path="${{ runner.temp }}\windhawk"
echo "Extracting $installer_path to $extract_path"
MSYS_NO_PATHCONV=1 "$installer_path" /S /PORTABLE "/D=$extract_path"
- name: Install dependencies
run: npm install
- name: Prepare static content
run: npx tsx deploy.ts
env:
WINDHAWK_MODS_LAST_DEPLOY_PATH: ${{ runner.temp }}\last_deploy
WINDHAWK_PATH: ${{ runner.temp }}\windhawk
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: pages
publish_dir: ./
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'