Skip to content

Commit

Permalink
- Remove tagging from PR workflow
Browse files Browse the repository at this point in the history
- Convert repository name to lowercase as tags can't have any char in UPPER
  • Loading branch information
gummigroda committed Oct 9, 2024
1 parent eba6c8d commit 5e6f3ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/tools-container-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,20 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Stupid, lowercase tag
- name: Lowercase tags
id: lowercase
run: |
echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT
# Original
- name: Build and push container image
uses: docker/build-push-action@v6
with:
cache-from: ghcr.io/${{github.repository}}/tools:latest
file: docker/Dockerfile
context: docker
tags: ghcr.io/${{github.repository}}/tools:latest
tags: ghcr.io/l${{ steps.lowercase.outputs.repository }}/tools:latest
push: true

# Light multiArch image
Expand All @@ -44,6 +50,6 @@ jobs:
cache-from: ghcr.io/${{github.repository}}/tools:lite
file: docker/Dockerfile.lite
context: docker
tags: ghcr.io/${{github.repository}}/tools:lite
tags: ghcr.io/l${{ steps.lowercase.outputs.repository }}/tools:lite
platforms: linux/amd64,linux/arm64
push: true
1 change: 0 additions & 1 deletion .github/workflows/tools-container-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ jobs:
context: docker
platforms: linux/amd64,linux/arm64
push: false
tags: ghcr.io/${{github.repository}}/tools:lite
10 changes: 4 additions & 6 deletions .github/workflows/tools-container-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
release:
types:
- published
paths:
- "docker/**"
- ".github/**"

jobs:
publish_latest:
Expand All @@ -31,22 +28,23 @@ jobs:
id: get_tag
run: |
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT
- name: Build and push container image
uses: docker/build-push-action@v6
with:
cache-from: ghcr.io/${{github.repository}}/tools:latest
file: docker/Dockerfile
context: docker
tags: ghcr.io/${{github.repository}}/tools:${{ steps.get_tag.outputs.tag }}
tags: ghcr.io/${{ steps.get_tag.outputs.repository }}/tools:${{ steps.get_tag.outputs.tag }}
push: true

- name: '[LITE] Build and push container image'
uses: docker/build-push-action@v6
with:
cache-from: ghcr.io/${{github.repository}}/tools:lite
file: docker/Dockerfile
file: docker/Dockerfile.lite
context: docker
tags: ghcr.io/${{github.repository}}/tools:lite-${{ steps.get_tag.outputs.tag }}
tags: ghcr.io/${{ steps.get_tag.outputs.repository }}/tools:lite-${{ steps.get_tag.outputs.tag }}
platforms: linux/amd64,linux/arm64
push: true

0 comments on commit 5e6f3ba

Please sign in to comment.