Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
8727b1c8
Unverified
Commit
8727b1c8
authored
May 29, 2023
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci: build assets outside docker
parent
56d7f4b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
38 deletions
+32
-38
build.yml
.github/workflows/build.yml
+31
-18
Dockerfile
dev/build/Dockerfile
+1
-20
No files found.
.github/workflows/build.yml
View file @
8727b1c8
...
...
@@ -15,6 +15,11 @@ jobs:
steps
:
-
uses
:
actions/checkout@v3
-
name
:
Setup Node.js environment
uses
:
actions/setup-node@v2.5.2
with
:
node-version
:
20.x
-
name
:
Set Build Variables
run
:
|
echo "REL_VERSION=3.0.0-alpha.$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
...
...
@@ -33,6 +38,12 @@ jobs:
with
:
read_key
:
${{ secrets.LOCALAZY_KEY_READ }}
-
name
:
Build Assets
working-directory
:
ux
run
:
|
npm ci --audit=false --fund=false
npm run build
-
name
:
Login to GitHub Container Registry
uses
:
docker/login-action@v2
with
:
...
...
@@ -56,24 +67,26 @@ jobs:
push
:
true
# cache-from: type=gha
# cache-to: type=gha,mode=max
#
platforms: linux/amd64,linux/arm64
platforms
:
linux/amd64,linux/arm64
tags
:
|
ghcr.io/requarks/wiki:${{ env.REL_VERSION }}
-
name
:
Extract compiled files
-
name
:
Prepare build archive
run
:
|
mkdir -p _dist
docker create --name wiki ghcr.io/requarks/wiki:$REL_VERSION_STRICT
docker cp wiki:/wiki _dist
docker rm wiki
rm _dist/wiki/config.yml
cp ./config.sample.yml _dist/wiki/config.sample.yml
find _dist/wiki/ -printf "%P\n" | tar -czf wiki-js.tar.gz --no-recursion -C _dist/wiki/ -T -
-
name
:
Upload a Build Artifact
cp assets _dist/assets
cp server _dist/server
cp LICENSE _dist/LICENSE
cp config.sample.yml _dist/config.sample.yml
cd server
npm ci --omit=dev --audit=false --fund=false
cd ..
tar -czf wiki-js.tar.gz --no-recursion -C _dist .
-
name
:
Upload Build Artifact
uses
:
actions/upload-artifact@v3
with
:
name
:
drop
name
:
build
path
:
wiki-js.tar.gz
windows
:
...
...
@@ -85,18 +98,18 @@ jobs:
-
name
:
Setup Node.js environment
uses
:
actions/setup-node@v2.5.2
with
:
node-version
:
18
.x
node-version
:
20
.x
-
name
:
Download
a
Build Artifact
-
name
:
Download Build Artifact
uses
:
actions/download-artifact@v3
with
:
name
:
drop
path
:
drop
name
:
build
path
:
build
-
name
:
Extract Build
run
:
|
mkdir -p win
tar -xzf $env:GITHUB_WORKSPACE\
drop
\wiki-js.tar.gz -C $env:GITHUB_WORKSPACE\win --exclude=server/node_modules
tar -xzf $env:GITHUB_WORKSPACE\
build
\wiki-js.tar.gz -C $env:GITHUB_WORKSPACE\win --exclude=server/node_modules
-
name
:
Install Dependencies
run
:
npm ci --omit=dev --audit=false --fund=false
...
...
@@ -105,9 +118,9 @@ jobs:
-
name
:
Create Bundle
run
:
tar -czf wiki-js-windows.tar.gz -C $env:GITHUB_WORKSPACE\win .
-
name
:
Upload
a
Build Artifact
-
name
:
Upload Build Artifact
uses
:
actions/upload-artifact@v3
with
:
name
:
drop
-win
name
:
build
-win
path
:
wiki-js-windows.tar.gz
dev/build/Dockerfile
View file @
8727b1c8
# ====================
# --- Build Assets ---
# ====================
FROM
node:20 AS assets
RUN
apt-get update
&&
apt-get
install
-qy
build-essential
WORKDIR
/wiki
COPY
./ux ./ux
COPY
./dev ./dev
RUN
cd
ux
&&
\
npm ci
--audit
=
false
--fund
=
false
&&
\
npm run build
# ===============
# --- Release ---
# ===============
FROM
node:20
LABEL
maintainer="requarks.io"
...
...
@@ -35,7 +16,7 @@ RUN mkdir -p /wiki && \
WORKDIR
/wiki
COPY
--chown=node:node
--from=assets /wiki
/assets ./assets
COPY
--chown=node:node
.
/assets ./assets
COPY
--chown=node:node ./server ./server
COPY
--chown=node:node ./dev/build/config.yml ./config.yml
COPY
--chown=node:node ./LICENSE ./LICENSE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment