diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 6b235ac..adf2684 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -33,6 +33,16 @@ jobs: # https://github.com/actions/checkout uses: actions/checkout@v4 + - name: Protector Metadata + shell: bash + run: > + jq -n \ + --arg repo ${{ github.repository }} \ + --arg branch ${{ github.ref_name }} \ + --arg revision ${{ github.sha }} \ + --arg buildDate "$(date --iso-8601=seconds --utc)" \ + '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, buildDate: $buildDate}' > protector_metadata.json + - name: Login to Docker Hub # https://github.com/docker/login-action uses: docker/login-action@v3 @@ -73,6 +83,7 @@ jobs: file: ${{ inputs.DOCKERFILE_PATH }} tags: ${{ steps.meta-production.outputs.tags }} build-args: ${{ secrets.BUILD_ARGS }} + context: . - name: Sync README with Docker Hub description if: ${{ github.ref_name == env.LATEST_TAG }} @@ -89,6 +100,20 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout GitHub repository + # https://github.com/actions/checkout + uses: actions/checkout@v4 + + - name: Protector Metadata + shell: bash + run: > + jq -n \ + --arg repo ${{ github.repository }} \ + --arg branch ${{ github.ref_name }} \ + --arg revision ${{ github.sha }} \ + --arg buildDate "$(date --iso-8601=seconds --utc)" \ + '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, buildDate: $buildDate}' > protector_metadata.json + - name: Login to Docker Hub # https://github.com/docker/login-action uses: docker/login-action@v3 @@ -119,6 +144,7 @@ jobs: file: ${{ inputs.DOCKERFILE_PATH }} tags: ${{ steps.meta-pr.outputs.tags }} build-args: ${{ secrets.BUILD_ARGS }} + context: . delete-pr-image: if: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }} @@ -138,6 +164,20 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout GitHub repository + # https://github.com/actions/checkout + uses: actions/checkout@v4 + + - name: Protector Metadata + shell: bash + run: > + jq -n \ + --arg repo ${{ github.repository }} \ + --arg branch ${{ github.ref_name }} \ + --arg revision ${{ github.sha }} \ + --arg buildDate "$(date --iso-8601=seconds --utc)" \ + '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, buildDate: $buildDate}' > protector_metadata.json + - name: Login to Docker Hub # https://github.com/docker/login-action uses: docker/login-action@v3 @@ -168,6 +208,7 @@ jobs: file: ${{ inputs.DOCKERFILE_PATH }} tags: ${{ steps.meta-branch.outputs.tags }} build-args: ${{ secrets.BUILD_ARGS }} + context: . delete-branch-image: if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch' && startsWith(github.event.ref, 'preview/') }}