Skip to content

ui: update puzzle history appearance for Storme and Racer #20894

ui: update puzzle history appearance for Storme and Racer

ui: update puzzle history appearance for Storme and Racer #20894

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:
types: [opened, synchronize, reopened, labeled]
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
- name: Install pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- name: Setup node and restore pnpm cache
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .node-version
cache: 'pnpm'
- name: Install pnpm dependencies
run: pnpm install
- name: Checkout ab (optional)
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
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' ||
contains(github.event.pull_request.labels.*.name, 'preview')
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- 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@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Log in to GitHub Container Registry
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: ghcr.io/${{ github.repository }}-assets
tags: |
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
file: .github/workflows/docker/assets.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
deploy:
name: deploy preview
if: github.repository_owner == 'lichess-org' && github.ref_name == github.event.repository.default_branch
needs: docker
uses: lichess-org/.github/.github/workflows/deploy.yml@main
secrets:
deploy_webhook_url: ${{ secrets.DEPLOY_PREVIEW_ASSETS_URL }}