Build fixes
This commit is contained in:
27
.github/workflows/build_docker.yml
vendored
27
.github/workflows/build_docker.yml
vendored
@@ -1,22 +1,23 @@
|
||||
name: Build zurg-testing docker image
|
||||
name: Build Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- v0*
|
||||
paths:
|
||||
- '**.go'
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
name: Docker Build
|
||||
runs-on: self-hosted
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Set version
|
||||
id: version
|
||||
run: echo "::set-output name=version::$(echo ${GITHUB_REF#refs/tags/})"
|
||||
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -54,16 +55,21 @@ jobs:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
build-args: |
|
||||
BuiltAt=$(date +%Y-%m-%dT%H:%M:%S)
|
||||
GoVersion=$(go version)
|
||||
GitCommit=$(git rev-parse HEAD)
|
||||
Version=${{ steps.version.outputs.version }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
if: startsWith(github.ref, 'refs/tags/v0')
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
id: publicmeta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}-testing
|
||||
|
||||
- name: Build and push Docker image
|
||||
if: startsWith(github.ref, 'refs/tags/v0')
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
@@ -73,3 +79,8 @@ jobs:
|
||||
labels: ${{ steps.publicmeta.outputs.labels }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
build-args: |
|
||||
BuiltAt=$(date +%Y-%m-%dT%H:%M:%S)
|
||||
GoVersion=$(go version)
|
||||
GitCommit=$(git rev-parse HEAD)
|
||||
Version=${{ steps.version.outputs.version }}
|
||||
|
||||
Reference in New Issue
Block a user