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