Skip to content

Commit

Permalink
Fix tag names with slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
mjanez authored Feb 8, 2024
1 parent ab16c5e commit c5b2200
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docker-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on: workflow_dispatch
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TAG: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
CONTEXT: .
BRANCH: ${{ github.ref_name }}
DOCKERFILE_PATH: .
Expand Down Expand Up @@ -42,11 +41,14 @@ jobs:
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}/blob/${{ env.BRANCH }}/README.md
org.opencontainers.image.version=${{ env.BRANCH }}
- name: Replace slashes in BRANCH to avoid errors
run: echo "BRANCH=${BRANCH////_}" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ env.TAG }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH }}
labels: ${{ steps.meta.outputs.labels }}
context: ${{ env.CONTEXT }}
file: ${{ env.CONTEXT }}${{ env.DOCKERFILE_PATH }}/${{ env.DOCKERFILE }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/docker-pr.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test ckan-mqa images (PR)
name: Test ckan-pycsw images (PR)

on:
pull_request:
Expand Down Expand Up @@ -39,6 +39,9 @@ jobs:
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}/blob/${{ env.BRANCH }}/README.md
org.opencontainers.image.version=${{ env.BRANCH }}
- name: Replace slashes in BRANCH to avoid errors
run: echo "BRANCH=${BRANCH////_}" >> $GITHUB_ENV

- name: Build to test
uses: docker/build-push-action@v5
id: docker-push
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TAG: ghcr.io/${{ github.repository }}:${{ github.head_ref }}
CONTEXT: .
BRANCH: ${{ github.head_ref }}
DOCKERFILE_PATH: .
Expand Down Expand Up @@ -49,11 +48,14 @@ jobs:
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}/blob/${{ env.BRANCH }}/README.md
org.opencontainers.image.version=${{ env.BRANCH }}
- name: Replace slashes in BRANCH to avoid errors
run: echo "BRANCH=${BRANCH////_}" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ env.TAG }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH }}
labels: ${{ steps.meta.outputs.labels }}
context: ${{ env.CONTEXT }}
file: ${{ env.CONTEXT }}${{ env.DOCKERFILE_PATH }}/${{ env.DOCKERFILE }}
Expand Down

0 comments on commit c5b2200

Please sign in to comment.