2024-10-17 18:52:34 +08:00
|
|
|
name: Docker-Build
|
|
|
|
|
|
|
|
on:
|
2024-11-01 16:19:47 +08:00
|
|
|
push:
|
|
|
|
branches: [ main ]
|
2024-10-17 18:52:34 +08:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
trigger-build:
|
|
|
|
description: 'Trigger a manual build and push'
|
|
|
|
default: 'true'
|
|
|
|
|
|
|
|
env:
|
2024-10-21 18:09:53 +08:00
|
|
|
DOCKER_IMAGE: donaldzou/wgdashboard
|
2024-10-17 18:52:34 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker_build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Log in to Docker Hub
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
- name: Build and export
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: true
|
|
|
|
tags: ${{ env.DOCKER_IMAGE }}:latest
|