generated from ryansonshine/typescript-npm-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add custom frontend container and add dev builds
- Loading branch information
Showing
4 changed files
with
115 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build Builder Docker image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "builder/**" | ||
- ".github/workflows/build-builder.yml" | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Login to GitHub Container Registry | ||
run: | | ||
echo $GITHUB_TOKEN | docker login ghcr.io -u EmuDeck --password-stdin | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build | ||
run: | | ||
cd builder | ||
docker build -t ghcr.io/EmuDeck/builder:latest . | ||
- name: Wait for other runs to complete | ||
uses: softprops/turnstyle@8db075d65b19bf94e6e8687b504db69938dc3c65 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push | ||
run: | | ||
docker push ghcr.io/EmuDeck/builder:latest | ||
- name: Log out of GitHub Container Registry | ||
run: | | ||
docker logout ghcr.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:18-alpine | ||
|
||
RUN apk add --no-cache rsync | ||
|
||
RUN npm i --location=global pnpm | ||
|
||
COPY ./entrypoint.sh /entrypoint.sh | ||
|
||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT [ "/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
cd /plugin | ||
|
||
if ! pnpm i --frozen-lockfile; | ||
then | ||
printf "error code: %s\npnpm lockfile not found or other error occurred, please report this issue to the CI maintainer and the plugin developer." "$?" | ||
exit 1 | ||
fi | ||
|
||
if [ $NODE_ENV == "development" ]; then | ||
if ! pnpm run dev; | ||
then | ||
printf "error code: %s\npnpm build failed, please report this issue to the CI maintainer and the plugin developer." "$?" | ||
exit 1 | ||
fi | ||
else | ||
if ! pnpm run build; | ||
then | ||
printf "error code: %s\npnpm build failed, please report this issue to the CI maintainer and the plugin developer." "$?" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
|
||
rsync -r --exclude "src/" --exclude "__pycache__" --exclude "node_modules" /plugin/ /out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters