Skip to content

Commit

Permalink
Merge pull request SillyTavern#2035 from caesarw/feat/build-nightly-s…
Browse files Browse the repository at this point in the history
…taging-image

Fix the wrong tags for the scheduled nightly build
  • Loading branch information
Cohee1207 authored Apr 7, 2024
2 parents b8ea75f + 299ee3a commit f3f29cf
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,34 @@ jobs:
runs-on: ubuntu-latest

steps:
## Workaround for GitHub repo names containing uppercase characters
# Workaround for GitHub repo names containing uppercase characters
- name: Set lowercase repo name
run: |
echo "IMAGE_NAME=${REPO,,}" >>${GITHUB_ENV}
echo "IMAGE_NAME=${REPO,,}" >> ${GITHUB_ENV}
# Using the following workaround because currently GitHub Actions
# does not support logical AND/OR operations on triggers
# It's currently not possible to have `branches` under the `schedule` trigger
- name: Checkout the release branch (on release)
if: ${{ github.event_name == 'release' }}
uses: actions/checkout@v3
with:
ref: "release"

- name: Checkout the release branch (on push)
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v3
if: ${{ github.event_name == 'release' || github.event_name == 'push' }}
uses: actions/[email protected]
with:
ref: "release"

- name: Checkout the staging branch
if: ${{ github.event_name == 'schedule' }}
uses: actions/checkout@v3
uses: actions/checkout@v4.1.2
with:
ref: "staging"

# Get current branch name
# This is also part of the workaround for Actions not allowing logical
# AND/OR operators on triggers
# Otherwise the action triggered by schedule always has ref_name = release
- name: Get the current branch name
run: |
echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> ${GITHUB_ENV}
# Setting up QEMU for multi-arch image build
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -62,7 +64,7 @@ jobs:
id: metadata
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: ${{ github.ref_name }}
tags: ${{ env.BRANCH_NAME }}

# Login into package repository as the person who created the release
- name: Log in to the Container registry
Expand Down

0 comments on commit f3f29cf

Please sign in to comment.