-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: refactor Docker setup and enhance GitHub actions
- New setup workflow file was added, containing a more detailed installation and configuration instructions for Docker. - Deduplicated Docker installation and setup steps in docker_publish.yml by incorporating the new setup workflow. - Centralized the Docker login, setup Buildx, and Docker metadata setup, which were originally repeated in several places. Signed-off-by: 陳鈞 <[email protected]>
- Loading branch information
Showing
2 changed files
with
82 additions
and
120 deletions.
There are no files selected for viewing
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,62 @@ | ||
name: Setup docker | ||
|
||
description: Configure the docker workflow. | ||
|
||
inputs: | ||
token: | ||
description: "A GitHub PAT" | ||
required: true | ||
tag: | ||
description: "A tag to use for the image" | ||
default: "no_model" | ||
|
||
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: false | ||
|
||
- name: Docker meta data:${{ inputs.tag }} | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/whisperx | ||
flavor: | | ||
latest=${{ if eq(inputs.tag, 'no_model') }}true{{ else }}false{{ endif }} | ||
prefix= | ||
suffix= | ||
tags: | | ||
${{ inputs.tag }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# Create a Access Token with `read:packages` and `write:packages` scopes | ||
# CR_PAT | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ inputs.token }} |
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