Skip to content

feat(metrics): integrate comprehensive metrics tracking across handlers #47

feat(metrics): integrate comprehensive metrics tracking across handlers

feat(metrics): integrate comprehensive metrics tracking across handlers #47

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches: [ main ]
paths-ignore: [ '**.md','docker-compose.yml' ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
include:
- arch: amd64
goarch: amd64
- arch: arm64
goarch: arm64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build binary
env:
GOOS: linux
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
go build -o proxy-go-${{ matrix.arch }}
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: proxy-go-${{ matrix.arch }}
path: proxy-go-${{ matrix.arch }}
docker:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: woodchen
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create Docker build context
run: |
mkdir -p docker-context
cp Dockerfile docker-context/
cp proxy-go-amd64/proxy-go-amd64 docker-context/proxy-go.amd64
cp proxy-go-arm64/proxy-go-arm64 docker-context/proxy-go.arm64
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: docker-context
platforms: linux/amd64,linux/arm64
push: true
tags: |
woodchen/proxy-go:latest
- name: Execute deployment commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: root
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
docker pull woodchen/proxy-go:latest
docker stop proxy-go || true
docker rm proxy-go || true
docker compose -f /opt/1panel/docker/compose/proxy-go/docker-compose.yml up -d