Skip to content

Commit

Permalink
with permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Administrator committed Oct 8, 2024
1 parent 0cba12e commit 384fb60
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/actions/build-publish-ocr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,28 @@ inputs:
token:
description: Github Token
required: true
username:
description: Github Token
required: true

runs:
using: composite
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ inputs.token }}
- name: Lowercase the repo name
shell: bash
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Login to ACR
- name: Check if image exists
shell: bash
run: docker login ${{ env.REGISTRY }} -u ${{ inputs.username }} -p ${{ inputs.token }}
id: image_check
run: docker manifest inspect ${{ env.REGISTRY }}/${{ env.REPO }}-ocr-api:${{ env.VERSION }} > /dev/null ; echo $?
- name: Build and push Docker image
id: push
if: steps.image_check.outcome == 1
uses: docker/build-push-action@v6
with:
context: ./OCR/
Expand Down

0 comments on commit 384fb60

Please sign in to comment.