mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-12-30 02:43:24 +08:00
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: Docker Image Build and Analysis
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * *" # Schedule the workflow to run daily at midnight (UTC time). Adjust the time if needed.
|
|
workflow_dispatch: # Manual run trigger
|
|
inputs:
|
|
trigger-build:
|
|
description: 'Trigger a manual build and push'
|
|
default: 'true'
|
|
|
|
jobs:
|
|
build-and-analyze:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build multiarch Docker image
|
|
id: build-image
|
|
run: |
|
|
docker buildx create --use
|
|
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t wg-dashboard:latest .
|
|
|
|
- name: Docker Scout
|
|
id: docker-scout
|
|
uses: docker/scout-action@v1
|
|
with:
|
|
command: scan
|
|
image: wg-dashboard:latest
|
|
ignore-unchanged: true
|
|
only-severities: critical,high
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|