mirror of
https://github.com/lemeow125/Notes.git
synced 2024-11-17 04:09:26 +08:00
vault backup: 2024-10-17 14:49:30
This commit is contained in:
parent
72885882b8
commit
1310639bc5
5 changed files with 55 additions and 7 deletions
11
.woodpecker/.build.yml
Normal file
11
.woodpecker/.build.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: node:18-alpine
|
||||||
|
when:
|
||||||
|
- branch: master
|
||||||
|
event: push
|
||||||
|
commands:
|
||||||
|
- docker build . -t "$IMAGE"
|
||||||
|
- echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY" --password-stdin -u "$REGISTRY_USERNAME"
|
||||||
|
- docker push "$IMAGE"
|
||||||
|
secrets: [REGISTRY, REGISTRY_USERNAME, REGISTRY_PASSWORD, IMAGE]
|
|
@ -1,7 +1,6 @@
|
||||||
# .woodpecker.yml
|
|
||||||
steps:
|
steps:
|
||||||
- name: build & copy
|
- name: deploy
|
||||||
image: node:18-alpine
|
image: alpine:3.20.3
|
||||||
when:
|
when:
|
||||||
- branch: master
|
- branch: master
|
||||||
event: push
|
event: push
|
||||||
|
@ -11,7 +10,10 @@ steps:
|
||||||
- echo "$SSH_KEY" | tr -d '\r' > /root/.ssh/id_rsa
|
- echo "$SSH_KEY" | tr -d '\r' > /root/.ssh/id_rsa
|
||||||
- chmod 600 /root/.ssh/id_rsa
|
- chmod 600 /root/.ssh/id_rsa
|
||||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
||||||
- npm install
|
- ssh -r "$REMOTE_HOST" 'cd "$PROJECT_DIRECTORY";
|
||||||
- npm run build
|
docker-compose down;
|
||||||
- scp -r build/* "$REMOTE_HOST:$PROJECT_DIRECTORY"
|
docker-compose up;'
|
||||||
secrets: [SSH_KEY, REMOTE_HOST, PROJECT_DIRECTORY]
|
secrets: [SSH_KEY, REMOTE_HOST, PROJECT_DIRECTORY]
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- build
|
22
Dockerfile
Normal file
22
Dockerfile
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
FROM node:18-alpine as build
|
||||||
|
|
||||||
|
WORKDIR /usr/local/app
|
||||||
|
|
||||||
|
COPY ./ /usr/local/app/
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
|
||||||
|
FROM nginx:latest
|
||||||
|
|
||||||
|
RUN rm -rf /usr/share/nginx/html/*
|
||||||
|
|
||||||
|
COPY --from=build /usr/local/app/ /usr/share/nginx/html
|
||||||
|
|
||||||
|
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
RUN service nginx restart
|
||||||
|
|
||||||
|
EXPOSE 80
|
|
@ -1,4 +1,4 @@
|
||||||
![Build Status](https://woodpecker.06222001.xyz/api/badges/5/status.svg)
|
![Build Status](https://woodpecker.06222001.xyz/api/badges/1/status.svg)
|
||||||
![Site Status](https://stats.keannu5.duckdns.org/api/badge/122/status)
|
![Site Status](https://stats.keannu5.duckdns.org/api/badge/122/status)
|
||||||
|
|
||||||
A GitHub mirror of my [Obsidian](https://obsidian.md/) blog posts, guides, and public notes.
|
A GitHub mirror of my [Obsidian](https://obsidian.md/) blog posts, guides, and public notes.
|
||||||
|
|
13
nginx/nginx.conf
Normal file
13
nginx/nginx.conf
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
sendfile on;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
server_name angularfrontend.lemnsea-fab4664b.westus3.azurecontainerapps.io;
|
||||||
|
gzip on;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html/dist/simpledmca-web/browser;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html =404;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue