-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.38 KB
/
qa.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Retag & Push
on:
release:
types: [created]
env:
ARTIFACT_NAME: hello-world-app
jobs:
retag_push_qa:
runs-on: ubuntu-latest
outputs:
sha_short: ${{ steps.prepare.outputs.sha_short }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Preparing job
id: prepare
run: |
SHA_SHORT=$(echo $GITHUB_SHA | cut -c1-7)
echo "SHA_SHORT=$SHA_SHORT" >> $GITHUB_ENV
echo "::set-output name=sha_short::$SHA_SHORT"
- name: Retag and push Docker Image with Release Name
run: |
docker pull kennyd3d/${{ env.ARTIFACT_NAME }}:$SHA_SHORT
docker tag kennyd3d/${{ env.ARTIFACT_NAME }}:$SHA_SHORT kennyd3d/${{ env.ARTIFACT_NAME }}:${{ github.event.release.tag_name }}
docker push kennyd3d/${{ env.ARTIFACT_NAME }}:${{ github.event.release.tag_name }}
Deploy:
name: Deploy 🚀
needs: retag_push_qa
uses: ./.github/workflows/deploy.yml
with:
namespace: "qa"
image: "kennyd3d/hello-world-app:${{ needs.retag_push_qa.outputs.sha_short }}"
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}