Skip to content

Commit 1ed4ff2

Browse files
committed
Update GitHub Actions workflow to use dynamic image name and enhance Docker image tagging with lowercase conversion and additional labels.
1 parent 66b1585 commit 1ed4ff2

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ on:
1010

1111
env:
1212
REGISTRY: ghcr.io
13-
IMAGE_NAME: rajsinghtech/tsflow
13+
IMAGE_NAME: ${{ github.repository }}
1414

1515
jobs:
1616
build:
1717
runs-on: ubuntu-latest
1818
permissions:
1919
contents: write
2020
packages: write
21+
id-token: write
22+
attestations: write
2123

2224
steps:
2325
- name: Checkout repository
@@ -56,6 +58,11 @@ jobs:
5658
if: github.event_name != 'pull_request'
5759
uses: docker/setup-buildx-action@v3
5860

61+
- name: Convert repository name to lowercase
62+
if: github.event_name != 'pull_request'
63+
run: |
64+
echo "IMAGE_NAME_LOWER=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
65+
5966
- name: Log in to Container Registry
6067
if: github.event_name != 'pull_request'
6168
uses: docker/login-action@v3
@@ -72,8 +79,11 @@ jobs:
7279
platforms: linux/amd64,linux/arm64
7380
push: true
7481
tags: |
75-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
76-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
82+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}:latest
83+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}:${{ github.sha }}
84+
labels: |
85+
org.opencontainers.image.source=${{ github.event.repository.html_url }}
86+
org.opencontainers.image.revision=${{ github.sha }}
7787
cache-from: type=gha
7888
cache-to: type=gha,mode=max
7989

@@ -100,11 +110,11 @@ jobs:
100110
101111
### Docker Installation
102112
```bash
103-
docker pull ghcr.io/rajsinghtech/tsflow:latest
113+
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}:latest
104114
docker run -p 8080:8080 \
105115
-e TAILSCALE_ACCESS_TOKEN="your-token" \
106116
-e TAILSCALE_TAILNET="your-tailnet" \
107-
ghcr.io/rajsinghtech/tsflow:latest
117+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}:latest
108118
```
109119
110120
### Binary Installation

0 commit comments

Comments
 (0)