Files
docker-builld-test/.gitea/workflows/test.yaml
2025-07-07 19:18:32 +05:30

37 lines
983 B
YAML

name: Docker Build and Publish
on:
workflow_dispatch:
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 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