61
61
APP : ' ${{matrix.app}}'
62
62
run : |
63
63
echo "APP_LOWERCASE=${APP,,}" >> $GITHUB_ENV
64
+
65
+ - name : Generate Date-Time Tag
66
+ id : tag
67
+ run : |
68
+ # Get the current date-time in YYYYMMDDHHMMSS format
69
+ TIMESTAMP=$(date +"%Y%m%d%H%M%S")
70
+ echo "Generated tag: $TIMESTAMP"
71
+ # Store it as an output to use in later steps
72
+ echo "GIT_TAG=$TIMESTAMP" >> $GITHUB_ENV
73
+
74
+ - name : Update k8s wids-idsse-1 deployments with git tag
75
+ if : ${{ github.ref == 'refs/heads/main' }}
76
+ run : |
77
+ sed -i "s/proxy:[^ ]\+/proxy:${GIT_TAG}/g" ./deployments/wids-idsse-1/nwsc-proxy.yml
78
+
79
+ - name : Pull before Push
80
+ run : |
81
+ git pull origin main
82
+
83
+ - name : Commit & push changes to k8s dev deployment yaml files
84
+ if : ${{ github.ref == 'refs/heads/main' }}
85
+ uses : actions-js/push@master
86
+ with :
87
+ message : Update k8s dev deployment yamls with git tag
88
+ github_token : ${{ secrets.GITHUB_TOKEN }}
64
89
65
90
- name : Build Image
66
91
run : |
@@ -69,13 +94,13 @@ jobs:
69
94
--build-arg BUILDVER="${{env.VERSION}}" \
70
95
--build-arg COMMITBRANCH=${{env.BRANCH}} \
71
96
--build-arg COMMITSHA=${{github.sha}} \
72
- -t ${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.BRANCH }} \
97
+ -t ${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.GIT_TAG }} \
73
98
-f ./docker/nwsc_proxy/dev/Dockerfile .
74
99
75
100
- name : Run Trivy vulnerability scanner
76
101
uses : aquasecurity/trivy-action@master
77
102
with :
78
- image-ref : ' ${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.BRANCH }}'
103
+ image-ref : ' ${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.GIT_TAG }}'
79
104
format : ' table'
80
105
# exit-code: '1'
81
106
ignore-unfixed : true
@@ -101,7 +126,7 @@ jobs:
101
126
102
127
- name : Push Image to Dev Registry
103
128
run : |
104
- docker push ${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.BRANCH }}
129
+ docker push ${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.GIT_TAG }}
105
130
job2 :
106
131
name : NWSC Proxy Service - UAT
107
132
needs : job1
0 commit comments