Some checks failed
Docker Build and Publish / build (push) Failing after 46s
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: Docker Build and Publish
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
DOCKERHUB_REPO: ghcr.io/ryuupendragon/caddy-test
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Parse Caddy version
|
|
id: version
|
|
run: echo "VERSION=$(grep -Eo 'caddy:[0-9]+\.[0-9]+\.[0-9]+$' Dockerfile | cut -d ':' -f2)" >> $GITHUB_ENV
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ vars.GH_USERNAME }}
|
|
password: ${{ secrets.GH_TOKEN }}
|
|
|
|
- name: Build and Push Docker images
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
platforms: linux/amd64, linux/arm64
|
|
tags: ${{ env.DOCKERHUB_REPO }}:${{ env.VERSION }}, ${{ env.DOCKERHUB_REPO }}:latest
|
|
file: Dockerfile
|
|
push: true
|