测试 CI

This commit is contained in:
Twilight 2024-08-09 00:05:41 +08:00
parent 65fd7f3703
commit 6dfabec9bc

View File

@ -0,0 +1,39 @@
name: Build
on:
push:
paths:
- manifest.yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- id: commit
uses: prompt/actions-commit-hash@v3
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 18
- name: Get dependencies
run: |
go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct
go mod download
- name: Build
run: |
npm install
npm run build
- name: 'Login to Container Registry'
uses: docker/login-action@v3
with:
registry: leafdev.top
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: 'Build Inventory Image'
run: |
docker build . -f Dockerfile --tag leafdev.top/leaf/amber-web:${{ steps.commit.outputs.short }}
docker push leafdev.top/leaf/amber-web:${{ steps.commit.outputs.short }}
docker tag leafdev.top/leaf/amber-web:${{ steps.commit.outputs.short }} leafdev.top/leaf/amber-web:latest