Update .github/workflows/docker-image.yml
All checks were successful
Docker Build and Publish / Build Docker image amd publish to Gitea (push) Successful in 19m34s
All checks were successful
Docker Build and Publish / Build Docker image amd publish to Gitea (push) Successful in 19m34s
This commit is contained in:
82
.github/workflows/docker-image.yml
vendored
82
.github/workflows/docker-image.yml
vendored
@@ -1,52 +1,58 @@
|
|||||||
name: Build and publish on dockerhub
|
name: Docker Build and Publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '30 6 * * SUN'
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**/README.md'
|
||||||
|
pull_request:
|
||||||
|
branches: [ "main" ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**/README.md'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
## define job to build and publish docker image
|
||||||
|
build-and-push-docker-image:
|
||||||
|
name: Build Docker image amd publish to Gitea
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
## This is used to complete the identity challenge
|
||||||
|
## with sigstore/fulcio when running outside of PRs.
|
||||||
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check disk usage
|
- name: Checkout repository
|
||||||
run: df -h
|
|
||||||
|
|
||||||
- name: Remove unused Docker images
|
|
||||||
run: docker system prune -af
|
|
||||||
|
|
||||||
- name: Clean up temporary files
|
|
||||||
run: sudo rm -rf /tmp/*
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
## https://github.com/docker/build-push-action
|
||||||
|
- name: Setup Docker buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
## https://github.com/docker/login-action
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.GITEA_USERNAME }}
|
registry: git.sdgarren.com
|
||||||
password: ${{ secrets.GITEA_TOKEN }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
## https://github.com/docker/build-push-action
|
||||||
uses: docker/metadata-action@v5
|
- name: Build and push Docker image
|
||||||
with:
|
id: build-and-push
|
||||||
# list of Docker images to use as base name for tags
|
|
||||||
images: |
|
|
||||||
${{ secrets.DOCKERHUB_USERNAME }}/rocm-wyoming-whisper
|
|
||||||
# generate Docker tags based on the following events/attributes
|
|
||||||
tags: |
|
|
||||||
type=raw,value={{date 'YYYY-MM-DD-HH.mm' tz='Europe/Rome'}}
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
|
provenance: false
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
platforms: linux/amd64
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: |
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
git.sdgarren.com/scott/rocm-wyoming-whisper:latest
|
||||||
#cache-from: type=gha
|
|
||||||
#cache-to: type=gha,mode=max
|
- name: Image digest
|
||||||
|
run: echo ${{ steps.build-and-push.outputs.digest }}
|
||||||
Reference in New Issue
Block a user