nsarrazin HF Staff commited on
Commit
b72cc53
·
unverified ·
1 Parent(s): 29db50b

feat: add commit SHA to published docker image

Browse files
Files changed (1) hide show
  1. .github/workflows/build-image.yml +8 -0
.github/workflows/build-image.yml CHANGED
@@ -61,6 +61,9 @@ jobs:
61
  username: ${{ github.repository_owner }}
62
  password: ${{ secrets.GITHUB_TOKEN }}
63
 
 
 
 
64
  - name: Build and Publish Docker Image with DB
65
  uses: docker/build-push-action@v5
66
  with:
@@ -74,6 +77,7 @@ jobs:
74
  cache-to: type=gha,mode=max
75
  build-args: |
76
  INCLUDE_DB=true
 
77
  build-and-publish-image-nodb:
78
  runs-on: ubuntu-latest
79
  steps:
@@ -117,6 +121,9 @@ jobs:
117
  username: ${{ github.repository_owner }}
118
  password: ${{ secrets.GITHUB_TOKEN }}
119
 
 
 
 
120
  - name: Build and Publish Docker Image without DB
121
  uses: docker/build-push-action@v5
122
  with:
@@ -130,3 +137,4 @@ jobs:
130
  cache-to: type=gha,mode=max
131
  build-args: |
132
  INCLUDE_DB=false
 
 
61
  username: ${{ github.repository_owner }}
62
  password: ${{ secrets.GITHUB_TOKEN }}
63
 
64
+ - name: Inject slug/short variables
65
+ uses: rlespinasse/[email protected]
66
+
67
  - name: Build and Publish Docker Image with DB
68
  uses: docker/build-push-action@v5
69
  with:
 
77
  cache-to: type=gha,mode=max
78
  build-args: |
79
  INCLUDE_DB=true
80
+ PUBLIC_COMMIT_SHA=${{ env.GITHUB_SHA_SHORT }}
81
  build-and-publish-image-nodb:
82
  runs-on: ubuntu-latest
83
  steps:
 
121
  username: ${{ github.repository_owner }}
122
  password: ${{ secrets.GITHUB_TOKEN }}
123
 
124
+ - name: Inject slug/short variables
125
+ uses: rlespinasse/[email protected]
126
+
127
  - name: Build and Publish Docker Image without DB
128
  uses: docker/build-push-action@v5
129
  with:
 
137
  cache-to: type=gha,mode=max
138
  build-args: |
139
  INCLUDE_DB=false
140
+ PUBLIC_COMMIT_SHA=${{ env.GITHUB_SHA_SHORT }}