From 33d936a865c9b1f7d79fcf8456a1612039697b0b Mon Sep 17 00:00:00 2001 From: Filippo Casarin Date: Sat, 3 Feb 2024 17:02:23 +0100 Subject: [PATCH] docker --- .github/workflows/deploy.yml | 26 ++++---------------------- package.json | 2 +- tools/build.sh | 7 +++++++ 3 files changed, 12 insertions(+), 23 deletions(-) create mode 100755 tools/build.sh diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ef5e1ae..4df1ade 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,9 +1,6 @@ name: Deploy -on: - push: - branches: - - main +on: push jobs: deploy: @@ -14,27 +11,12 @@ jobs: with: submodules: 'recursive' - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Install asymptote - run: sudo apt-get install -y asymptote - - - name: Asymptote workaround - run: sudo ln -sf /tmp/textput.log /tmptexput.log - - name: Setup package registry run: | - npm config set @olinfo:registry https://git.olinfo.it/api/packages/bortoz/npm/ - npm config set -- '//git.olinfo.it/api/packages/bortoz/npm/:_authToken' "${{ secrets.GITEA_TOKEN }}" - - - name: Install dependencies - run: yarn install --frozen-lockfile + echo "//git.olinfo.it/api/packages/bortoz/npm/:_authToken=${{ secrets.GITEA_TOKEN }}" >> .npmrc - - name: Build - run: yarn build + - name: Docker + run: docker run -v .:/scolastiche archlinux /scolastiche/tools/build.sh - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 diff --git a/package.json b/package.json index aaf2b94..4c000ad 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "scripts": { - "postinstall": "playwright install chromium", + "postinstall": "playwright install chromium && yarn playwright install-deps", "dev": "quizms dev", "fmt": "prettier --write .", "build": "quizms build --training" diff --git a/tools/build.sh b/tools/build.sh new file mode 100755 index 0000000..3b586e8 --- /dev/null +++ b/tools/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -xe + +cd scolastiche +pacman -Sy --noconfirm asymptote yarn +yarn install --frozen-lockfile +yarn build