Skip to content

Deploy static content #1705

Deploy static content

Deploy static content #1705

Workflow file for this run

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"
- 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'