mirror of
https://github.com/DeanWard/CaddyGen.git
synced 2025-10-30 06:07:12 +00:00
feat: add GitHub Actions workflow for Docker build and publish
This commit is contained in:
35
.github/workflows/docker-publish.yml
vendored
Normal file
35
.github/workflows/docker-publish.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Docker Build and Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Checkout the repository
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Set up Docker Buildx
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
# Log in to Docker Hub
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
# Build and push the multi-platform image
|
||||
- name: Build and push multi-platform Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: wardy784/caddygen:latest
|
||||
Reference in New Issue
Block a user