Compare commits
5 Commits
main
...
1100be75c5
| Author | SHA1 | Date | |
|---|---|---|---|
| 1100be75c5 | |||
| 59001d5e97 | |||
| 46d9b8df94 | |||
| 7912f59fb8 | |||
| 90771b85e9 |
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -18,8 +18,8 @@ jobs:
|
||||
run: bun install
|
||||
- name: Build
|
||||
run: bun run build
|
||||
- name: Write git hash into dist
|
||||
run: echo "export const GIT_HASH = '$(git rev-parse HEAD)';" > dist/git-hash.js
|
||||
- name: Write Git-Hash into html
|
||||
run: ./pipeline/create-git-hash-html.sh
|
||||
- name: Create Build Artifact
|
||||
uses: christopherhx/gitea-upload-artifact@v4
|
||||
with:
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
FROM oven/bun as builder
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN bun install
|
||||
RUN bun run build
|
||||
|
||||
FROM nginx:alpine
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
COPY ./dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -16,7 +16,7 @@ http {
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
try_files $uri $uri/ /index.html /git-hash.js;
|
||||
}
|
||||
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#!/bin/bash
|
||||
13
pipeline/create-git-hash-html.sh
Executable file
13
pipeline/create-git-hash-html.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
# create git-hash.html
|
||||
echo "<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Git Hash</title>
|
||||
</head>
|
||||
<body>
|
||||
<pre>GITHUB_SHA = '$GITHUB_SHA';</pre>
|
||||
</body>
|
||||
</html>" > dist/git-hash.html
|
||||
Reference in New Issue
Block a user