Skip to content

workspace upgrade to TypeScript 6, bump ApexCharts for the compatibility #19523

workspace upgrade to TypeScript 6, bump ApexCharts for the compatibility

workspace upgrade to TypeScript 6, bump ApexCharts for the compatibility #19523

Workflow file for this run

name: Build assets
env:
ACTIONS_STEP_DEBUG: true
on:
push:
paths:
- '.github/workflows/assets.yml'
- 'public/**'
- 'ui/**'
- 'package.json'
- 'pnpm-lock.yaml'
- '.node-version'
pull_request:
paths:
- '.github/workflows/assets.yml'
- 'public/**'
- 'ui/**'
- 'package.json'
- 'pnpm-lock.yaml'
- '.node-version'
workflow_dispatch:
jobs:
assets:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Install pnpm
uses: pnpm/action-setup@8912a9102ac27614460f54aedde9e1e7f9aec20d # v6.0.5
- name: Setup node and restore pnpm cache
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .node-version
cache: 'pnpm'
- name: Install pnpm dependencies
run: pnpm install
- name: Checkout ab (optional)
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: lichess-org/ab
ssh-key: ${{ secrets.id_rsa_ab }}
ref: master
path: ab
env:
HAS_AB: ${{ secrets.id_rsa_ab != '' }}
if: env.HAS_AB == 'true'
id: ab
- name: Link ab (optional)
run: pnpm link "$GITHUB_WORKSPACE/ab"
if: steps.ab.outcome == 'success'
- name: Print tool versions
run: node -v && pnpm -v && cd ui/.build && pnpm tsc -v
- name: Build
run: ./ui/build --no-install -p
- name: Tests
run: ./ui/test
- name: Prepare asset dir
run: |
mkdir -p assets/public
mv public/compiled public/css public/hashed public/npm assets/public/
cp -p LICENSE COPYING.md README.md assets/
git log -n 1 --pretty=oneline > assets/commit.txt
- name: Tar assets
run: cd assets && tar --zstd -cvpf ../assets.tar.zst . && cd -
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: lila-assets
path: assets.tar.zst
compression-level: 0 # already compressed
docker:
runs-on: ubuntu-latest
needs: assets
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: lila-assets
- name: Extract assets
run: |
mkdir -p assets
tar --zstd -xvf assets.tar.zst -C assets
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Log in to GitHub Container Registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
with:
images: ghcr.io/${{ github.repository }}-assets
tags: |
type=ref,event=branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
with:
context: .
file: .github/workflows/docker/assets.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
deploy:
if: github.repository == 'lichess-org/lila' && github.ref_name == github.event.repository.default_branch
needs: docker
runs-on: ubuntu-latest
steps:
- name: deploy to preview site
env:
DEPLOY_WEBHOOK_URL: ${{ secrets.DEPLOY_PREVIEW_ASSETS_URL }}
run: curl -X POST $DEPLOY_WEBHOOK_URL