Skip to content

Delete docker-entrypoint.sh (#51) #76

Delete docker-entrypoint.sh (#51)

Delete docker-entrypoint.sh (#51) #76

name: Build and push image to DockerHub and GitHub Container Registry
on:
push:
tags:
- 'v*'
branches:
- main
workflow_dispatch:
inputs:
manual-tag:
description: 'Manual Tag'
required: false
default: 'main'
type: string
ghost_version:
description: 'Ghost version'
required: true
default: '5.66.0'
type: string
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
network=host
image=moby/buildkit:master
-
name: Set up GHOST_VERSION and MANUAL_TAG values, depending on event type (push or workflow_dispatch)
id: versions
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
run: |
if [ ${{ env.GITHUB_EVENT_NAME }} == workflow_dispatch ]; then
echo "GHOST_VERSION=${{ github.event.inputs.ghost_version }}" >> $GITHUB_OUTPUT
echo "MANUAL_TAG=${{ github.event.inputs.manual-tag }}" >> $GITHUB_OUTPUT
else
echo "GHOST_VERSION=$(curl -s https://api.github.com/repos/tryghost/ghost/releases/latest | jq '.name' | sed 's/\"//g')" >> $GITHUB_OUTPUT
echo "MANUAL_TAG=auto" >> $GITHUB_OUTPUT
fi
- name: Show GHOST_VERSION
run: |
echo ${{ steps.versions.outputs.GHOST_VERSION }}
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
docker.io/${{ secrets.DOCKER_USER }}/${{ github.event.repository.name }}
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=tag
type=raw,value=${{ steps.versions.outputs.MANUAL_TAG }}
type=raw,value=latest
labels: |
org.opencontainers.image.title=ghost-on-kubernetes
org.opencontainers.image.description=Ghost CMS upstream v5 (latest release), with node 18-lts, without gosu, updated dependencies
org.opencontainers.image.vendor=https://sredevops.org
org.opencontainers.image.source=https://github.com/sredevopsdev/ghost-on-kubernetes.git
org.opencontainers.image.documentation=https://github.com/sredevopsdev/ghost-on-kubernetes/blob/main/README.md
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GHOST_VERSION=${{ steps.versions.outputs.GHOST_VERSION }}