Skip to content

Commit

Permalink
Merge pull request #1 from alexo-bunnyshell/feature/blue-navbar
Browse files Browse the repository at this point in the history
add new workflow (and make header blue)
  • Loading branch information
alexo-bunnyshell authored Mar 12, 2024
2 parents 0deffde + b33415b commit a38d5dc
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 11 deletions.
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

0 comments on commit a38d5dc

Please sign in to comment.