Skip to content

Merge pull request #8 from ucpr/dependabot/go_modules/golang.org/x/ne… #8

Merge pull request #8 from ucpr/dependabot/go_modules/golang.org/x/ne…

Merge pull request #8 from ucpr/dependabot/go_modules/golang.org/x/ne… #8

name: Publish Container Image
on:
push:
tags:
- 'v*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Login to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=sha,format=long
- name: Set timestamp
id: timestamp
env:
TZ: 'UTC'
run: echo "TIMESTAMP=$(date -u '+%Y-%m-%d_%I:%M:%S%p')" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args:
VERSION=${{ steps.meta.outputs.tags }}
REVISION=${{ github.sha }}
TIMESTAMP=${{ steps.timestamp.outputs.TIMESTAMP }}