Skip to content

Commit

Permalink
readme and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
EndangeredF1sh committed Oct 23, 2024
1 parent 83747a2 commit fa450fc
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
58 changes: 58 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Docker Build and Push

on:
push:
branches: [ "main" ]
paths:
- '**.py'
- 'Dockerfile'
- 'requirements.txt'
pull_request:
branches: [ "main" ]
paths:
- '**.py'
- 'Dockerfile'
- 'requirements.txt'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Generate build date
id: date
run: echo "BUILD_DATE=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=git-${{ github.sha::7 }}-${{ steps.date.outputs.BUILD_DATE }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ To run the PDF2Audio app:

2. **Run**
```bash
docker run -p 7860:7860 pdf2audio
docker run -d -p 7860:7860 --name pdf2audio pdf2audio
```

3. **Access the Gradio interface:** `http://localhost:7860`.
Expand Down

0 comments on commit fa450fc

Please sign in to comment.