generated from jim60105/Dockerfile-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: 陳鈞 <[email protected]>
- Loading branch information
Showing
8 changed files
with
119 additions
and
220 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
72 changes: 0 additions & 72 deletions
72
!workflows/docker-publish/docker-reused-setup-steps/action.yml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Setup docker | ||
|
||
description: Configure the docker workflow. | ||
|
||
inputs: | ||
CR_PAT: | ||
required: true | ||
tag: | ||
required: true | ||
default: EDGE | ||
|
||
outputs: | ||
tags: | ||
description: "tags" | ||
value: ${{ steps.meta.outputs.tags }} | ||
labels: | ||
description: "labels" | ||
value: ${{ steps.meta.outputs.labels }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
# this might remove tools that are actually needed, | ||
# if set to "true" but frees about 6 GB | ||
tool-cache: true | ||
|
||
# all of these default to true, but feel free to set to | ||
# "false" if necessary for your workflow | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
large-packages: true | ||
docker-images: true | ||
swap-storage: true | ||
|
||
- name: Docker meta:${{ inputs.tag }} | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/stable-diffusion-webui | ||
tags: | | ||
${{ inputs.tag }} | ||
type=raw,value=latest,enable=${{ inputs.tag == 'EDGE' }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# Create a Access Token with `read:packages` and `write:packages` scopes | ||
# CR_PAT | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ inputs.CR_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: docker_publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
tags: | ||
- "v*" | ||
schedule: | ||
- cron: "0 7 1 * *" # 1st day of month at 7am UTC | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Checkout submodule | ||
run: | | ||
cd stable-diffusion-webui && \ | ||
git fetch --all --tags && \ | ||
if [[ "${{ github.ref }}" == refs/tags/* ]]; then | ||
git checkout tags/${{ github.ref_name }} -b ${{ github.ref_name }} | ||
else | ||
git checkout master | ||
fi | ||
- name: Setup docker | ||
id: setup | ||
uses: ./.github/workflows/docker-reused-setup-steps | ||
with: | ||
CR_PAT: ${{ secrets.CR_PAT }} | ||
tag: ${{ github.head_ref || github.ref_name }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
target: final | ||
tags: ${{ steps.setup.outputs.tags }} | ||
labels: ${{ steps.setup.outputs.labels }} | ||
build-args: VERSION=${{ github.head_ref || github.ref_name }} | ||
platforms: linux/amd64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ jobs: | |
- name: Run Trivy vulnerability scanner for alpine image | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: "ghcr.io/jim60105/fc2-live-dl:alpine" | ||
image-ref: "ghcr.io/jim60105/stable-diffusion-webui:alpine" | ||
vuln-type: "os,library" | ||
scanners: vuln | ||
severity: "CRITICAL,HIGH" | ||
|
@@ -35,7 +35,7 @@ jobs: | |
- name: Run Trivy vulnerability scanner for ubi image | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: "ghcr.io/jim60105/fc2-live-dl:ubi" | ||
image-ref: "ghcr.io/jim60105/stable-diffusion-webui:ubi" | ||
vuln-type: "os,library" | ||
scanners: vuln | ||
severity: "CRITICAL,HIGH" | ||
|
@@ -46,7 +46,7 @@ jobs: | |
- name: Run Trivy vulnerability scanner for distroless image | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: "ghcr.io/jim60105/fc2-live-dl:distroless" | ||
image-ref: "ghcr.io/jim60105/stable-diffusion-webui:distroless" | ||
vuln-type: "os,library" | ||
scanners: vuln | ||
severity: "CRITICAL,HIGH" | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters