Skip to content

Commit

Permalink
revert deletion of ci/cd and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zrll12 committed Oct 31, 2024
1 parent 5a808af commit 9f3ac70
Show file tree
Hide file tree
Showing 6 changed files with 268 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI/CD

on:
push:
branches: [ "main" ]
workflow_dispatch:

jobs:
build_docker:
name: Build docker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/klpbbs-survey-backend:latest
cache-from: type=gha
cache-to: type=gha,mode=max
build_docker_acr:
name: Build docker ACR
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to ACR
uses: aliyun/acr-login@v1
with:
login-server: https://registry.cn-guangzhou.aliyuncs.com
username: "${{ secrets.REGISTRY_USERNAME }}"
password: "${{ secrets.REGISTRY_PASSWORD }}"
- name: Build and push image
run: |
docker build -t registry.cn-guangzhou.aliyuncs.com/teamvastsea/klpbbs-survey-backend:latest .
docker push registry.cn-guangzhou.aliyuncs.com/teamvastsea/klpbbs-survey-backend:latest
deploy:
name: Deploy
needs: [build_docker, build_docker_acr]
runs-on: ubuntu-latest
steps:
- name: SSH To Host
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ${{ secrets.PROJ_PATH }}
sudo bash ./deploy.sh
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# cargo-chef and the Rust toolchain
FROM lukemathwalker/cargo-chef AS chef
WORKDIR /app

# prepare recipe
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json

# build artifact
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
## build dependencies
RUN cargo chef cook --release --recipe-path recipe.json
## build application
COPY . .
RUN cargo build --release

# build slim image
FROM debian:bookworm-slim AS runtime
WORKDIR /app
COPY --from=builder /app/target/release/klpbbs_survey_backend /usr/app/klpbbs_survey_backend

RUN \
apt-get update && \
apt-get install -y curl vim openssl

RUN \
apt-get clean && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/*


WORKDIR /usr/app

CMD ["/usr/app/klpbbs_survey_backend"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Vastsea

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<div align="center">
<img width="128" src="./favicon.svg" alt="logo">
<h1> KLPBBS | SURVEY </h1>
</div>

<p align="center">
<img src="https://img.shields.io/github/license/TeamVastsea/klpbbs_survey_frontend" alt="GitHub License">
<img src="https://github.com/TeamVastsea/klpbbs_survey_frontend/actions/workflows/docker-image.yml/badge.svg" alt="Docker Image CI">
</p>

<p align="center">
<b>
English |
<a href="./README_CN.md">简体中文</a>
</b>
</p>

In order to make it easier and faster for KLPBBS users to fill out survey, KLPBBS worked with a number of developers from the Vastsea team to create a seamlessly integrated survey system

Using this system, KLPBBS users can quickly log in using their KLPBBS account without having to repeatedly register or create a new account, greatly optimizing the user experience

## Licence

This project is licensed under the MIT license, please refer to [LICENCE](./LICENSE) for details

## Contribute

If you encounter any problems in using the project, you can [submit an Issue](https://github.com/TeamVastsea/klpbbs_survey_frontend/issues/new) or [Fork](https://github.com/TeamVastsea/klpbbs_survey_frontend/fork) this project to submit an Pull Request.

## Thanks

- **zrll_** Front-end, Back-end, Test
- [GitHub](https://github.com/zrll12)
- [KLPBBS](https://klpbbs.com/?922084)

- **Snowball_233** Front-end, CI/CD, Ops, Doc
- [GitHub](https://github.com/SnowballXueQiu)
- [KLPBBS](https://klpbbs.com/?1082463)

- **M397749490** CI/CD, Ops
- [GitHub](https://github.com/M397749490)
- [KLPBBS](https://klpbbs.com/?32980)

- **damesck** Front-end, Doc
- [GitHub](https://github.com/damesck233)
- [KLPBBS](https://klpbbs.com/?6173)

- **GaoNeng-wWw** Front-end
- [GitHub](https://github.com/GaoNeng-wWw)

- **klpz** API Provide
- [GitHub](https://github.com/klpbbs)
- [KLPBBS](https://klpbbs.com/?1)
53 changes: 53 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<div align="center">
<img width="128" src="./favicon.svg" alt="logo">
<h1> 苦力怕论坛 | 问卷系统 </h1>
</div>

<p align="center">
<img src="https://img.shields.io/github/license/TeamVastsea/klpbbs_survey_frontend" alt="GitHub License">
<img src="https://github.com/TeamVastsea/klpbbs_survey_frontend/actions/workflows/docker-image.yml/badge.svg" alt="Docker Image CI">
</p>

<p align="center">
<b>
<a href="./README.md">English</a>
| 简体中文
</b>
</p>

为了让论坛用户能够更加简单、快速地填写问卷, 苦力怕论坛与瀚海工艺团队的多位开发者共同合作, 合力打造了一个无缝集成的问卷系统

使用此程序, 论坛用户可以使用苦力怕论坛账号快速登录, 而无需重复注册或创建新的账号, 极大地优化了用户体验

## 许可

本项目使用 MIT 协议授权, 详见 [许可证文件](./LICENSE)

## 贡献

如果你在使用过程中发现任何问题, 可以 [提交 Issue](https://github.com/TeamVastsea/klpbbs_survey_frontend/issues/new) 或自行 [Fork](https://github.com/TeamVastsea/klpbbs_survey_frontend/fork) 修改后提交 Pull Request

## 感谢

- **zrll_** 前端, 后端, 测试
- [GitHub](https://github.com/zrll12)
- [苦力怕论坛](https://klpbbs.com/?922084)

- **Snowball_233** 前端, CI/CD, 运维, 文档
- [GitHub](https://github.com/SnowballXueQiu)
- [苦力怕论坛](https://klpbbs.com/?1082463)

- **M397749490** CI/CD, 运维
- [GitHub](https://github.com/M397749490)
- [苦力怕论坛](https://klpbbs.com/?32980)

- **damesck** 前端, 文档
- [GitHub](https://github.com/damesck233)
- [苦力怕论坛](https://klpbbs.com/?6173)

- **GaoNeng-wWw** 前端
- [GitHub](https://github.com/GaoNeng-wWw)

- **苦力怕纸** API提供
- [GitHub](https://github.com/klpbbs)
- [苦力怕论坛](https://klpbbs.com/?1)
40 changes: 40 additions & 0 deletions favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9f3ac70

Please sign in to comment.