Skip to content

Commit

Permalink
build: reset pr pipeline docker tag
Browse files Browse the repository at this point in the history
  • Loading branch information
chideat committed Aug 30, 2024
1 parent 9025f50 commit c2a0cf7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/pr-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ jobs:
- name: Check out code
uses: actions/checkout@v4

- name: Read version from file
id: get_version
- name: Setup envs
id: setup_envs
run: |
ls -la
echo "VERSION=$(cat version)" >> $GITHUB_ENV
VERSION=$(git tag --merged $BRANCH_NAME --sort=-v:refname | head -n 1)
if [ -z "$VERSION" ]; then
VERSION="3.18.0"
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Get branch name
id: get_branch
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
BRANCH_NAME=${{ github.head_ref }}
else
Expand All @@ -61,9 +61,9 @@ jobs:
SANITIZED_BRANCH_NAME=$(echo "$BRANCH_NAME" | tr -cs '[:alnum:]' '-' | sed 's/-*$//' | tr '[:upper:]' '[:lower:]')
echo "BRANCH_NAME=$SANITIZED_BRANCH_NAME" >> $GITHUB_ENV
- name: Get short commit SHA
id: get_commit
run: echo "COMMIT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
echo "TIMESTAMP=$(date -u +'%y%m%d%H%M')" >> $GITHUB_ENV
echo "COMMIT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -87,6 +87,6 @@ jobs:
file: ./build/Dockerfile
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ env.VERSION }}-${{ env.BRANCH_NAME }}-${{ env.COMMIT_SHA }}
tags: ghcr.io/${{ github.repository }}:${{ env.VERSION }}-${{ env.BRANCH_NAME }}-${{ env.TIMESTAMP }}.${{ env.COMMIT_SHA }}
platforms: linux/amd64,linux/arm64

1 change: 0 additions & 1 deletion version

This file was deleted.

0 comments on commit c2a0cf7

Please sign in to comment.