ci: build develop tag on every push to develop branch
- Triggers on develop branch in addition to release/* branches - Develop pushes get tagged as :develop only - Release pushes continue to get :version, :release, and :latest tags
This commit is contained in:
@@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'release/**'
|
- 'release/**'
|
||||||
|
- 'develop'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -12,15 +13,24 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Extract version from package.json
|
- name: Compute image tags
|
||||||
id: version
|
id: meta
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(node -p "require('./package.json').version")
|
VERSION=$(node -p "require('./package.json').version")
|
||||||
BRANCH=${GITHUB_REF#refs/heads/}
|
BRANCH=${GITHUB_REF#refs/heads/}
|
||||||
RELEASE_NAME=${BRANCH#release/}
|
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
echo "release=${RELEASE_NAME}" >> $GITHUB_OUTPUT
|
|
||||||
echo "Building version ${VERSION} from branch ${BRANCH}"
|
if [ "$BRANCH" = "develop" ]; then
|
||||||
|
echo "tags=reg.i3omb.com/sofarr:develop" >> $GITHUB_OUTPUT
|
||||||
|
echo "Building develop image (version ${VERSION})"
|
||||||
|
else
|
||||||
|
RELEASE_NAME=${BRANCH#release/}
|
||||||
|
TAGS="reg.i3omb.com/sofarr:${VERSION}"
|
||||||
|
TAGS="${TAGS},reg.i3omb.com/sofarr:${RELEASE_NAME}"
|
||||||
|
TAGS="${TAGS},reg.i3omb.com/sofarr:latest"
|
||||||
|
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Building release image ${VERSION} from branch ${BRANCH}"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
@@ -34,10 +44,7 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
tags: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
reg.i3omb.com/sofarr:${{ steps.version.outputs.version }}
|
|
||||||
reg.i3omb.com/sofarr:${{ steps.version.outputs.release }}
|
|
||||||
reg.i3omb.com/sofarr:latest
|
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.version=${{ steps.version.outputs.version }}
|
org.opencontainers.image.version=${{ steps.meta.outputs.version }}
|
||||||
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
|
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
|
||||||
|
|||||||
Reference in New Issue
Block a user