Skip to content

Build cert-req Docker image for the GitHub Container Registry #18

Build cert-req Docker image for the GitHub Container Registry

Build cert-req Docker image for the GitHub Container Registry #18

name: cert-req-build-ghcr
run-name: Build cert-req Docker image for the GitHub Container Registry
on:
workflow_dispatch:
push:
branches:
- "main"
paths:
- 'Dockerfile'
- 'server.cnf'
- 'scripts/**'
jobs:
image-build:
runs-on: ubuntu-latest
steps:
- name: Set timezone
uses: zcong1993/setup-timezone@master
with:
timezone: "Europe/Athens"
- name: Get date
id: date
run: echo "push_date=$(date '+%H:%M@%d/%m/%Y')" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Base image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/gunet/cert-req:latest
labels: gr.gunet.cert-req.pushdate=${{ steps.date.outputs.push_date }}
cache-from: type=gha
cache-to: type=gha,mode=max