Skip to content

Commit 2ac0539

Browse files
feat: tag to sha
1 parent 2711ca3 commit 2ac0539

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/deploy-frontend.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ env:
88
REGISTRY: ghcr.io
99
REPO_NAME: ${{ github.repository }}
1010
IMAGE_NAME: ${{ github.sha }}
11+
REPO_OWNER: ${{ github.repository_owner }}
1112

1213
jobs:
1314
release:
@@ -25,13 +26,15 @@ jobs:
2526
fetch-depth: 0
2627

2728
- name: LOGIN TO GITHUB CONTAINER REGISTRY
28-
run: docker login ${{ env.REGISTRY }} -u ${{ github.repository_owner }} -p "${{ secrets.GHCR_TOKEN }}"
29+
run: docker login ${{ env.REGISTRY }} -u ${{ env.REPO_OWNER }} -p "${{ secrets.GHCR_TOKEN }}"
2930

3031
- name: EXTRACT METADATA FOR DOCKER
3132
id: meta
3233
uses: docker/metadata-action@v4
3334
with:
34-
images: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}:${{ env.IMAGE_NAME }}
35+
images: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}
36+
tags: |
37+
type=sha
3538
3639
- name: BUILD AND PUSH
3740
uses: docker/build-push-action@v4
@@ -106,7 +109,7 @@ jobs:
106109
kubectl apply -f frontend-service.yml
107110
108111
echo "SETTING NEW TAG TO DEPLOYMENT"
109-
kubectl set image deployment/sskd-frontend-deployment sskd-frontend=${{ env.REGISTRY }}/${{ env.REPO_NAME }}:${{ env.IMAGE_NAME }} -n sskd
112+
kubectl set image deployment/sskd-frontend-deployment sskd-frontend=${{ env.REGISTRY }}/${{ env.REPO_NAME }}:${{ steps.meta.outputs.version }} -n sskd
110113
111114
echo "WAITING FOR POD"
112115
kubectl rollout status deployment/sskd-frontend-deployment -n sskd --timeout=300s

k3s/frontend-deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
- name: ghcr-secret-frontend
2020
containers:
2121
- name: sskd-frontend
22-
image: ghcr.io/etozhealkhipce/senior-script-kiddie:main
22+
image: ghcr.io
2323
imagePullPolicy: Always
2424
ports:
2525
- containerPort: 80

0 commit comments

Comments
 (0)