From 6dfabec9bce48b34d330182d68c3ba48b8a6dad4 Mon Sep 17 00:00:00 2001 From: Twilight Date: Fri, 9 Aug 2024 00:05:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .gitea/workflows/build.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..b706565 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -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 \ No newline at end of file