|
8 | 8 | - "[0-9]*.[0-9]*.[0-9]*" |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - # build-tag-push: |
12 | | - # runs-on: ubuntu-latest |
13 | | - # strategy: |
14 | | - # matrix: |
15 | | - # path: |
16 | | - # - 06-demo-application/api-golang |
17 | | - # - 06-demo-application/api-node |
18 | | - # - 06-demo-application/client-react |
19 | | - # - 06-demo-application/load-generator-python |
20 | | - # - 06-demo-application/postgresql |
21 | | - |
22 | | - # steps: |
23 | | - # - name: Checkout |
24 | | - # uses: actions/checkout@v4 |
25 | | - # with: |
26 | | - # # Necessary to get all tags for IMAGE_TAG generation with git describe |
27 | | - # fetch-depth: 0 |
28 | | - |
29 | | - # - name: Install Task |
30 | | - # uses: arduino/setup-task@v2 |
31 | | - # with: |
32 | | - # version: 3.x |
33 | | - |
34 | | - # - name: Set up QEMU |
35 | | - # uses: docker/setup-qemu-action@v3 |
36 | | - |
37 | | - # - name: Set up Docker Buildx |
38 | | - # uses: docker/setup-buildx-action@v3 |
39 | | - |
40 | | - # - name: Login to Docker Hub |
41 | | - # uses: docker/login-action@v3 |
42 | | - # with: |
43 | | - # username: ${{ secrets.DOCKERHUB_USERNAME }} |
44 | | - # password: ${{ secrets.DOCKERHUB_TOKEN }} |
45 | | - |
46 | | - # - name: Generate Image Tag |
47 | | - # id: generate-image-tag |
48 | | - # working-directory: 14-cicd/github-actions |
49 | | - # run: | |
50 | | - # image_tag=$(task generate-version-tag) |
51 | | - # echo "image_tag=$image_tag" >> $GITHUB_OUTPUT |
52 | | - |
53 | | - # - uses: actions/setup-go@v4 |
54 | | - # if: matrix.path == '06-demo-application/api-golang' |
55 | | - # with: |
56 | | - # go-version: "1.22.x" |
57 | | - |
58 | | - # - uses: ko-build/[email protected] |
59 | | - # if: matrix.path == '06-demo-application/api-golang' |
60 | | - # with: |
61 | | - # version: v0.15.4 |
62 | | - |
63 | | - # - name: Build Image |
64 | | - # env: |
65 | | - # IMAGE_TAG: ${{ steps.generate-image-tag.outputs.image_tag }} |
66 | | - # working-directory: ${{ matrix.path }} |
67 | | - # run: | |
68 | | - # task build-container-image-multi-arch IMAGE_TAG=${IMAGE_TAG} |
| 11 | + build-tag-push: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + path: |
| 16 | + - 06-demo-application/api-golang |
| 17 | + - 06-demo-application/api-node |
| 18 | + - 06-demo-application/client-react |
| 19 | + - 06-demo-application/load-generator-python |
| 20 | + - 06-demo-application/postgresql |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + # Necessary to get all tags for IMAGE_TAG generation with git describe |
| 27 | + fetch-depth: 0 |
| 28 | + |
| 29 | + - name: Install Task |
| 30 | + uses: arduino/setup-task@v2 |
| 31 | + with: |
| 32 | + version: 3.x |
| 33 | + |
| 34 | + - name: Set up QEMU |
| 35 | + uses: docker/setup-qemu-action@v3 |
| 36 | + |
| 37 | + - name: Set up Docker Buildx |
| 38 | + uses: docker/setup-buildx-action@v3 |
| 39 | + |
| 40 | + - name: Login to Docker Hub |
| 41 | + uses: docker/login-action@v3 |
| 42 | + with: |
| 43 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 44 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 45 | + |
| 46 | + - name: Generate Image Tag |
| 47 | + id: generate-image-tag |
| 48 | + working-directory: 14-cicd/github-actions |
| 49 | + run: | |
| 50 | + image_tag=$(task generate-version-tag) |
| 51 | + echo "image_tag=$image_tag" >> $GITHUB_OUTPUT |
| 52 | +
|
| 53 | + - uses: actions/setup-go@v4 |
| 54 | + if: matrix.path == '06-demo-application/api-golang' |
| 55 | + with: |
| 56 | + go-version: "1.22.x" |
| 57 | + |
| 58 | + - uses: ko-build/[email protected] |
| 59 | + if: matrix.path == '06-demo-application/api-golang' |
| 60 | + with: |
| 61 | + version: v0.15.4 |
| 62 | + |
| 63 | + - name: Build Image |
| 64 | + env: |
| 65 | + IMAGE_TAG: ${{ steps.generate-image-tag.outputs.image_tag }} |
| 66 | + working-directory: ${{ matrix.path }} |
| 67 | + run: | |
| 68 | + task build-container-image-multi-arch IMAGE_TAG=${IMAGE_TAG} |
69 | 69 |
|
70 | 70 | update-tags: |
71 | 71 | runs-on: ubuntu-latest |
72 | | - # needs: build-tag-push |
| 72 | + needs: build-tag-push |
73 | 73 |
|
74 | 74 | steps: |
75 | 75 | - name: Checkout |
@@ -108,4 +108,4 @@ jobs: |
108 | 108 | - name: Create Pull Request |
109 | 109 | uses: peter-evans/create-pull-request@v6 |
110 | 110 | with: |
111 | | - token: ${{ secrets.DEVOPS_DIRECTIVE_KUBERNETES_COURSE_GITHUB_ACTION }} |
| 111 | + token: ${{ secrets.DEVOPS_DIRECTIVE_KUBERNETES_COURSE_GITHUB_ACTION_PAT }} |
0 commit comments