Skip to content

Commit

Permalink
do not build client in every image.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed Sep 30, 2023
1 parent e7b9d39 commit 763db14
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,56 @@ env:
IMAGE_NAME: m1k1o/neko-rooms

jobs:
build:
build-client:
runs-on: ubuntu-latest
#
# do not run on forks
#
if: github.repository_owner == 'm1k1o'
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
-
name: Install dependencies
run: npm install
-
name: Build
run: npm run build
-
name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: client
path: dist

build-docker:
needs: build-client
runs-on: ubuntu-latest
#
# do not run on forks
#
if: github.repository_owner == 'm1k1o'
steps:
-
name: Download client artifact
uses: actions/download-artifact@v2
with:
name: client
path: ./client/dist
-
name: Remove client stage from Dockerfile
# Change dockerfile: remove first stage - everything between # STAGE 1 and # STAGE 2
# Replace "--from=frontend /src/dist/" with "./client/dist/"
run: |
sed -i '/# STAGE 1/,/# STAGE 2/d' ./Dockerfile
sed -i 's/--from=frontend \/src\/dist\//.\/client\/dist\//g' ./Dockerfile
-
name: Checkout
uses: actions/checkout@v2
Expand Down

0 comments on commit 763db14

Please sign in to comment.