修改名称
This commit is contained in:
38
.gitea/workflows/template-vitepress-ci-cd.yaml
Normal file
38
.gitea/workflows/template-vitepress-ci-cd.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
name: CI Pipeline
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: gitea/runner-images:ubuntu-latest
|
||||
steps:
|
||||
- name: 拉取代码
|
||||
uses: https://devstar.cn/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 安装依赖
|
||||
working-directory:
|
||||
run: |
|
||||
npm install
|
||||
npm add -D vitepress
|
||||
|
||||
- name: 构建项目
|
||||
working-directory:
|
||||
run: |
|
||||
chmod +x node_modules/.bin/vitepress
|
||||
npm run docs:build
|
||||
|
||||
- name: 构建 Docker 镜像
|
||||
run: |
|
||||
docker build -t template-vitepress:${{ gitea.sha }} .
|
||||
|
||||
- name: 登录 Docker Registry 并推送镜像
|
||||
run: |
|
||||
echo "${{ secrets.DOCKER_REGISTRY_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_REGISTRY_USERNAME }} ${{ vars.DOCKER_REGISTRY_ADDRESS }} --password-stdin
|
||||
docker tag template-vitepress:${{ gitea.sha }} ${{ vars.DOCKER_REGISTRY_ADDRESS }}/${{ vars.DOCKER_REPOSITORY_ARTIFACT}}:${{ gitea.sha }}
|
||||
docker tag template-vitepress:${{ gitea.sha }} ${{ vars.DOCKER_REGISTRY_ADDRESS }}/${{ vars.DOCKER_REPOSITORY_ARTIFACT}}:latest
|
||||
docker push ${{ vars.DOCKER_REGISTRY_ADDRESS }}/${{ vars.DOCKER_REPOSITORY_ARTIFACT}}:${{ gitea.sha }}
|
||||
docker push ${{ vars.DOCKER_REGISTRY_ADDRESS }}/${{ vars.DOCKER_REPOSITORY_ARTIFACT}}:latest
|
||||
Reference in New Issue
Block a user