Skip to content

update xanzy/go-gitlab #109

update xanzy/go-gitlab

update xanzy/go-gitlab #109

Workflow file for this run

name: Docker Image
on:
push:
tags:
- '**'
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set build date
run: echo "BUILD_DATE=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v3
if: startsWith(github.ref, 'refs/tags/')
with:
context: .
build-args: |
versionflags=-X 'github.com/flant/glaball/pkg/util.Version=${{ github.ref_name }}' -X 'github.com/flant/glaball/pkg/util.Revision=${{ github.sha }}' -X 'github.com/flant/glaball/pkg/util.Branch=${{ github.ref_name }}' -X 'github.com/flant/glaball/pkg/util.BuildUser=${{ github.actor }}' -X 'github.com/flant/glaball/pkg/util.BuildDate=${{ env.BUILD_DATE }}'
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}