Skip to content

Commit 22c6847

Browse files
authored
Merge pull request #4 from kotaicode/add-workflow
wip
2 parents 9f30a4a + 29f5cd3 commit 22c6847

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed
Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Update Deployment with Commit Hash
2+
23
on:
34
workflow_run:
4-
workflows: ['Build and Push to GitHub Container Registry']
5-
types: [completed]
5+
workflows: ['Build and Push to GitHub Container Registry']
6+
types: [completed]
7+
68
jobs:
79
update-deployment:
810
runs-on: ubuntu-latest
@@ -14,13 +16,20 @@ jobs:
1416
ref: main
1517
token: ${{ secrets.GH_TOKEN }}
1618

17-
- name: Setup git config
19+
- name: Setup Git Config
20+
run: |
21+
git config --global user.name "github-actions[bot]"
22+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
23+
24+
- name: Update Deployment YAML with Commit Hash
1825
run: |
19-
git config --global user.name ${{secrets.USER_NAME}}
20-
git config --global user.email ${{secrets.EMAIL}}
21-
echo ${{github.sha}}
26+
echo "Updating deployment with commit hash: ${{ github.sha }}"
2227
sed -i "s|\(image:.*:\).*|\1${{ github.sha }}|" k8s-brouter-web/deployment-brouter-web.yaml
2328
git add k8s-brouter-web/deployment-brouter-web.yaml
24-
git commit -m "Update deployment with commit hash"
25-
- run: echo ${{github}}
26-
- run: git push
29+
git commit -m "Update deployment with commit hash ${{ github.sha }}"
30+
31+
- name: Push Changes
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: |
35+
git push origin main

0 commit comments

Comments
 (0)