Skip to content

Commit

Permalink
Set up CI
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrudenko committed May 25, 2024
0 parents commit 6c03826
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/cmake-single-platform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CMake on a single platform
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: MinSizeRel
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: peterrudenko/alien-algebra
submodules: recursive
fetch-depth: 8
- name: Install Cheerp
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 84540D4B9BF457D5
sudo add-apt-repository ppa:leaningtech-dev/cheerp-ppa
sudo apt-get update
sudo apt-get install cheerp-core
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=/opt/cheerp/bin/clang -DCMAKE_CXX_COMPILER=/opt/cheerp/bin/clang++ -DBUILD_WEB_CLIENT=ON -G "CodeBlocks - Unix Makefiles"
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target WebGame -- -j 2
- name: Copy static files
run: |
mkdir ${{github.workspace}}/public
cp Source/index.html ${{github.workspace}}/public/
cp ${{github.workspace}}/build/game.js ${{github.workspace}}/public/
ls -la ${{github.workspace}}/public
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages

0 comments on commit 6c03826

Please sign in to comment.