Files
tg_exporter/.gitea/workflows/build.yml
Rogee c3d7a9ef15
Some checks failed
Build TGExporter / Build (push) Failing after 3m17s
feat: update ci
2024-11-22 14:19:10 +08:00

44 lines
1.3 KiB
YAML

name: Build TGExporter
run-name: ${{ gitea.actor }} Build TGExporter
on: [push]
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies and build frontend
run: |
cd frontend
npm config set registry https://npm.hub.ipao.vip
npm install
npm run build
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.22"
- name: Build Go application
run: |
mkdir -p build
go env -w GOPROXY=https://go.hub.ipao.vip,direct
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/exporter .
- name: Build final Docker image
run: |
docker login -u ${{ secrets.DOCKER_AF_USERNAME }} -p ${{ secrets.DOCKER_AF_PASSWORD }} docker-af.hub.ipao.vip
docker build --push -t docker-af.hub.ipao.vip/rogeecn/tg-exporter:latest .
# curl -kL https://portainer.ipao.vip/api/stacks/webhooks/178f9e9d-6700-40b3-9f2f-364fd273deab --data {}
- name: Notify Portainer to update stack
run: |
curl -kL https://portainer.ipao.vip/api/stacks/webhooks/178f9e9d-6700-40b3-9f2f-364fd273deab --data {}