Skip to content

Change build step order to be similar to dockerfile #88

Change build step order to be similar to dockerfile

Change build step order to be similar to dockerfile #88

Workflow file for this run

name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ no, sv, da, nl ]
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Cache data
uses: actions/cache@v4
id: iso
with:
path: iso/mullebil_${{ matrix.language }}.iso
key: game-iso-${{ matrix.language }}-${{ hashFiles('iso/mullebil_*.iso') }}
restore-keys: game-iso-${{ matrix.language }}-
- name: Cache binaries
uses: actions/cache@v4
id: bin
with:
path: bin
key: bin-${{ hashFiles('bin/*') }}
restore-keys: bin-
- name: Cache APT packages
uses: actions/cache@v4
id: apt
with:
path: /tmp/apt
key: apt-${{ hashFiles('/tmp/apt/pkgcache.bin') }}
restore-keys: apt-
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache NPM packages
uses: actions/cache@v4
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install APT packages
run: |
mkdir -p /tmp/apt/archives
sudo cp -r /tmp/apt /var/cache
sudo apt-get update
sudo apt-get install ffmpeg optipng
sudo cp /var/cache/apt/*.bin /tmp/apt
sudo cp -r /var/cache/apt/archives/*.deb /tmp/apt/archives
- run: npm install
- run: pip install -r requirements.txt
- name: Build webpack
run: python build_scripts/build.py webpack-prod
- name: Build phaser
run: python build_scripts/build.py phaser
- name: Download game
run: python build_scripts/build.py ${{ matrix.language }} download
- name: Extract scores
run: python build_scripts/build.py ${{ matrix.language }} scores
- name: Build assets
run: python assets.py 0 ./dist/assets
- name: Build HTML and CSS
run: python build_scripts/build.py ${{ matrix.language }} html_css
- name: Convert and copy UI images
run: python build_scripts/build.py ui-images
- name: Build topography
run: python build_scripts/build.py ${{ matrix.language }} topography
- name: Copy game data
run: cp -R data dist/data
- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.language }}
path: dist