Skip to content

fix docker build

fix docker build #4

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for git history and changelog generation
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
cache: true
- name: Install gcx
run: |
go build -o /usr/local/bin/gcx ./cmd/gcx
chmod +x /usr/local/bin/gcx
- name: Build release binaries
run: gcx build --config gcx.release.yaml
- name: Create GitHub Release
run: |
changelog=$(gcx release changelog --stable)
gh release create ${{ github.ref_name }} ./dist/* --notes "$changelog" --title ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ github.actor }}/gcx:latest
${{ github.actor }}/gcx:${{ github.ref_name }}
build-args: |
VERSION=${{ github.ref_name }}
COMMIT=${{ github.sha }}