This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 96b14cce0 fix ci image tag issue (#6144)
96b14cce0 is described below
commit 96b14cce0bd5601089b21a263f30efe49a41be44
Author: ZhangNing10 <[email protected]>
AuthorDate: Mon Sep 25 18:20:03 2023 +0800
fix ci image tag issue (#6144)
---
.github/workflows/build.yml | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 61550d088..29f442ba1 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -114,26 +114,17 @@ jobs:
build-args: |
TAG=${{ github.ref_name }}
SHA=${{ steps.get_short_sha.outputs.SHORT_SHA }}
- get-pr-number:
- name: Get pr number and build timestamp
+ get-timestamp:
+ name: Get build timestamp
runs-on: ubuntu-latest
outputs:
- pull_request_number: ${{ steps.pr.outputs.pull_request_number }}
timestamp: ${{ steps.ts.outputs.timestamp }}
steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- - name: Get pull request number
- id: pr
- run: echo "pull_request_number=$(gh pr view --json number -q .number
|| echo "")" >> $GITHUB_OUTPUT
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get build timestamp
id: ts
run: echo "timestamp=$(date '+%y%m%d_%H%M')" >> $GITHUB_OUTPUT
build-and-push-devlake:
- needs: [build-devlake, build-and-push-base, get-pr-number]
+ needs: [build-devlake, build-and-push-base, get-timestamp]
name: Build and Push devlake image
runs-on: ubuntu-latest
steps:
@@ -167,7 +158,7 @@ jobs:
elif printf ${{ github.ref }} |grep -Pq '^refs/tags/'; then
echo "TAGS=${image_name}:${{ github.ref_name }}" >>
$GITHUB_OUTPUT
else
- echo "TAGS=${image_name}:${{ github.ref_name }}_${{
needs.get-pr-number.outputs.timestamp }}_${{
steps.get_short_sha.outputs.SHORT_SHA }}_MR-${{
needs.get-pr-number.outputs.pull_request_number }}" >> $GITHUB_OUTPUT
+ echo "TAGS=${image_name}:${{ github.ref_name }}_${{
needs.get-timestamp.outputs.timestamp }}_${{
steps.get_short_sha.outputs.SHORT_SHA }}" >> $GITHUB_OUTPUT
fi
- name: Build and push lake image
uses: docker/build-push-action@v3
@@ -203,7 +194,7 @@ jobs:
}
build-and-push-other-image:
- needs: [get-pr-number]
+ needs: [get-timestamp]
name: Build and Push ${{ matrix.build.name }} image
runs-on: ubuntu-latest
strategy:
@@ -238,7 +229,7 @@ jobs:
elif printf ${{ github.ref }} |grep -Pq '^refs/tags/'; then
echo "TAGS=${image_name}:${{ github.ref_name }}" >>
$GITHUB_OUTPUT
else
- echo "TAGS=${image_name}:${{ github.ref_name }}_${{
needs.get-pr-number.outputs.timestamp }}_${{
steps.get_short_sha.outputs.SHORT_SHA }}_MR-${{
needs.get-pr-number.outputs.pull_request_number }}" >> $GITHUB_OUTPUT
+ echo "TAGS=${image_name}:${{ github.ref_name }}_${{
needs.get-timestamp.outputs.timestamp }}_${{
steps.get_short_sha.outputs.SHORT_SHA }}" >> $GITHUB_OUTPUT
fi
- name: Build and push ${{ matrix.build.name }} image
uses: docker/build-push-action@v3