Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new workflow (and make header blue) #1

Merged
merged 11 commits into from
Mar 12, 2024
25 changes: 25 additions & 0 deletions .github/workflows/bunnyshell_env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy Bunnyshell Env

concurrency: bns-deploy-${{ github.event.workflow_run.referenced_workflows[0].ref || format('refs/pull/{0}/merge', github.event.issue.number) }}


on:
workflow_run:
workflows:
- "Build and Push Docker image"
types:
- completed
issue_comment:
types: [ created, edited ]


jobs:
debug:
name: Bunnyshell
runs-on: ubuntu-latest
steps:
- name: "Debug"
run: |
echo "DEBUG: ${{ github.event.workflow_run.referenced_workflows[0].ref || format('refs/pull/{0}/merge', github.event.issue.number) }}"


2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,5 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
build/index.html
build/version.txt
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
from alpine as build

RUN apk add --no-cache sed
COPY app/ /app
RUN ls -alh /app
RUN echo "test"
RUN VERSION=$(cat /app/version.txt) \
#&& echo "version: $VERSION xxx" > /app/outversion.txt \
&& sed -i'' "s/--version--/$VERSION/g" /app/index.html

RUN mkdir /work
WORKDIR /work

COPY app/ app/
RUN ls -alh app

COPY build.sh build.sh
RUN chmod +x build.sh
RUN ./build.sh


from nginx:alpine as prod


COPY --from=build /app /usr/share/nginx/html
COPY --from=build /work/build /usr/share/nginx/html


4 changes: 2 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<body>

<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<nav class="navbar navbar-expand-lg navbar-light bg-primary">
<!--a class="navbar-brand" href="#">Demo</a-->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-center" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
<a class="nav-link active" aria-current="page" href="#">Home xx</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
Expand Down
17 changes: 17 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
# This script is used to build the project

#remove old build
rm -rf build

#copy the app to build
cp -a app build

cd build
#extract the VERSION variable
VERSION=$(cat version.txt)
echo "Version: $VERSION"
sed -i '.bak' "s/--version--/$VERSION/g" index.html
rm index.html.bak

echo "Build completed"
2 changes: 0 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ services:
target: prod
ports:
- "8080:80"
expose:
- 8080
Loading