Skip to content

Commit

Permalink
build(ci): merge tag and main ghcr build release file (#1205)
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah authored Dec 21, 2023
1 parent 70c8e86 commit ad47ec0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 57 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/release-ghcr-main.yml

This file was deleted.

16 changes: 6 additions & 10 deletions .github/workflows/release-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ name: release-ghcr

on:
push:
tags:
- v*
tags: [v*]
branches: [main]

jobs:
build:
Expand All @@ -26,18 +26,14 @@ jobs:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: prepare
id: prepare
run: |
VERSION=${GITHUB_REF#refs/*/}
BRANCH_NAME=${GITHUB_REF#refs/heads/}
if [[ "${VERSION}" == "${BRANCH_NAME}" ]]; then
VERSION=$(git rev-parse --short HEAD)
fi
echo "ref=ghcr.io/${{ github.repository }}:${VERSION}" >> $GITHUB_OUTPUT
TAG=${GITHUB_REF#refs/*/} # get branch or tag as image tag
echo "ref=ghcr.io/${{ github.repository }}:${TAG}" >> $GITHUB_OUTPUT
- name: docker login
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down

0 comments on commit ad47ec0

Please sign in to comment.