mirror of
https://git.webmc.xyz/Starlike-Client/Starlike-Client
synced 2025-06-05 18:32:01 -09:00
62 lines
2.0 KiB
YAML
62 lines
2.0 KiB
YAML
name: Build
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
jobs:
|
|
build:
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "21"
|
|
cache: "gradle"
|
|
- name: Validate Gradle Wrapper
|
|
uses: gradle/actions/wrapper-validation@v3
|
|
- name: Compile JavaScript
|
|
run: ./gradlew generateJavaScript
|
|
- name: Compile assets.epk
|
|
run: bash ./CompileEPK.sh
|
|
- name: Generate offline download
|
|
run: bash ./MakeOfflineDownload.sh
|
|
- name: Prepare web files
|
|
run: |
|
|
mkdir -p ${{ runner.temp }}/gh-pages
|
|
cp -t ${{ runner.temp }}/gh-pages \
|
|
javascript/assets.epk \
|
|
javascript/classes.js \
|
|
javascript/classes.js.map \
|
|
javascript/index.html
|
|
cp javascript/Starlike_Client_Offline.html ${{ runner.temp }}/gh-pages/offline.html
|
|
- name: Upload web files
|
|
continue-on-error: true
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: web
|
|
path: ${{ runner.temp }}/gh-pages/
|
|
retention-days: 1
|
|
compression-level: 9
|
|
- name: Upload offline download
|
|
continue-on-error: true
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: offline
|
|
path: javascript/Starlike_Client_Offline.html
|
|
retention-days: 1
|
|
compression-level: 9
|
|
- name: Deploy to GitHub Pages
|
|
if: github.ref == 'refs/heads/main'
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ${{ runner.temp }}/gh-pages
|
|
cname: starlike.zumbiepig.dev
|
|
force_orphan: true
|
|
user_name: 'github-actions[bot]'
|
|
user_email: '41898282+github-actions[bot]@users.noreply.github.com'
|
|
commit_message: 'github-actions: deploy'
|