mirror of
https://github.com/ChrispyBacon-dev/DockFlare.git
synced 2026-10-19 15:43:19 +00:00
132 lines
3.8 KiB
YAML
132 lines
3.8 KiB
YAML
# .github/workflows/docker-webmail.yml
|
|
name: Docker Image - Webmail
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "stable"
|
|
- "unstable"
|
|
- "dev"
|
|
- "dockflare-mail"
|
|
tags:
|
|
- "v*.*.*"
|
|
- "v*.*.*-*"
|
|
paths:
|
|
- "webmail/**"
|
|
pull_request:
|
|
branches:
|
|
- "stable"
|
|
- "unstable"
|
|
- "dev"
|
|
- "dockflare-mail"
|
|
paths:
|
|
- "webmail/**"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build_self_hosted:
|
|
runs-on: self-hosted
|
|
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
|
|
- name: Log in to Docker Hub
|
|
if: github.event_name == 'push'
|
|
uses: docker/login-action@v4
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v6
|
|
with:
|
|
images: alplat/dockflare-webmail
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{version}},suffix=-{{premajor}}-{{prerelease}}
|
|
type=ref,event=branch,pattern=stable,value=latest
|
|
type=ref,event=branch,pattern=stable,value=stable
|
|
type=ref,event=branch,pattern=unstable,value=unstable
|
|
type=ref,event=branch,pattern=dev,value=dev
|
|
type=sha,format=short
|
|
type=ref,event=tag
|
|
type=ref,event=branch
|
|
|
|
- name: Build and Push Docker Image
|
|
id: build_and_push
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: ./webmail
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name == 'push' }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha,scope=dockflare-webmail
|
|
cache-to: type=gha,mode=max,scope=dockflare-webmail
|
|
|
|
build_github_hosted_fallback:
|
|
needs: build_self_hosted
|
|
if: failure() || cancelled()
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
|
|
- name: Log in to Docker Hub
|
|
if: github.event_name == 'push'
|
|
uses: docker/login-action@v4
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v6
|
|
with:
|
|
images: alplat/dockflare-webmail
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{version}},suffix=-{{premajor}}-{{prerelease}}
|
|
type=ref,event=branch,pattern=stable,value=latest
|
|
type=ref,event=branch,pattern=stable,value=stable
|
|
type=ref,event=branch,pattern=unstable,value=unstable
|
|
type=ref,event=branch,pattern=dev,value=dev
|
|
type=sha,format=short
|
|
type=ref,event=tag
|
|
type=ref,event=branch
|
|
|
|
- name: Build and Push Docker Image
|
|
id: build_and_push
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: ./webmail
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name == 'push' }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha,scope=dockflare-webmail
|
|
cache-to: type=gha,mode=max,scope=dockflare-webmail
|