mirror of
https://github.com/dnlbauer/pdfact-service.git
synced 2026-09-10 22:25:30 +00:00
47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
name: Docker Image CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CONTAINER_REGISTRY_USER: dnlbauer
|
|
IMAGE_NAME: pdfact-service
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: set tag
|
|
id: tag
|
|
run: echo "::set-output name=tag::$(date +%s)"
|
|
- name: docker login
|
|
if: ${{github.event_name != 'pull_request'}}
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{env.CONTAINER_REGISTRY_USER}}
|
|
password: ${{secrets.DOCKER_PASSWORD}}
|
|
- name: docker build and push
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
push: ${{github.event_name != 'pull_request'}}
|
|
tags: ${{env.CONTAINER_REGISTRY_USER}}/${{env.IMAGE_NAME}}:latest , ${{env.CONTAINER_REGISTRY_USER}}/${{env.IMAGE_NAME}}:${{ steps.tag.outputs.tag }}
|
|
- name: docker push readme
|
|
uses: christian-korneck/update-container-description-action@v1
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
env:
|
|
DOCKER_USER: ${{env.CONTAINER_REGISTRY_USER}}
|
|
DOCKER_PASS: ${{secrets.DOCKER_PASSWORD}}
|
|
with:
|
|
destination_container_repo: ${{env.CONTAINER_REGISTRY_USER}}/${{env.IMAGE_NAME}}
|
|
provider: dockerhub
|
|
short_description: 'Analyze pdf files with pdfact using a simple web API.'
|
|
readme_file: 'README.md'
|