Skip to content

fix cli workflow

fix cli workflow #131

Workflow file for this run

name: Server
on:
push:
paths-ignore:
- "*.md"
- "cli/**"
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,prefix=
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Version Info
run: |
echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
echo "COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "BUILD_TIME=$(date --rfc-3339=seconds)" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ env.VERSION }}
COMMIT=${{ env.COMMIT }}
BUILD_TIME=${{ env.BUILD_TIME }}
deploy:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Deploy
uses: fjogeleit/http-request-action@v1
with:
url: "https://watchtower.topi.wtf/v1/update?image=ghcr.io/topi314/gobin"
method: "POST"
timeout: 60000
customHeaders: '{"Authorization": "Bearer ${{ secrets.TOKEN }}"}'