Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: reset pr pipeline docker tag #68

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ FROM $BUILDER_IMAGE AS builder
WORKDIR /workspace

# Copy the go source
COPY version version
COPY api/ api/
COPY cmd/ cmd/
COPY internal/ internal/
Expand Down
1 change: 0 additions & 1 deletion version

This file was deleted.

Loading