mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Updated cd script.
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
This commit is contained in:
parent
dd6556968c
commit
a90b788138
1 changed files with 25 additions and 5 deletions
30
.github/workflows/cd.yml
vendored
30
.github/workflows/cd.yml
vendored
|
|
@ -6,8 +6,8 @@ on:
|
||||||
- 'v*.*.*'
|
- 'v*.*.*'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
manual_tag:
|
version:
|
||||||
description: 'Optional image tag (e.g. 1.2.3, beta, nightly)'
|
description: 'Optional image version (e.g. 3.0.0, beta)'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|
||||||
|
|
@ -23,7 +23,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
# Install cosign (for image signing)
|
|
||||||
- name: Install cosign
|
- name: Install cosign
|
||||||
uses: sigstore/cosign-installer@v3
|
uses: sigstore/cosign-installer@v3
|
||||||
|
|
||||||
|
|
@ -45,6 +44,21 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# Normalize manual input if provided
|
||||||
|
- name: Normalize manual version
|
||||||
|
id: normalize
|
||||||
|
run: |
|
||||||
|
INPUT="${{ github.event.inputs.version }}"
|
||||||
|
if [[ -n "$INPUT" ]]; then
|
||||||
|
# Strip leading v if present
|
||||||
|
VERSION="${INPUT#v}"
|
||||||
|
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
||||||
|
MINOR=$(echo "$VERSION" | cut -d. -f2)
|
||||||
|
echo "version_tags=${VERSION},${MAJOR}.${MINOR},${MAJOR}" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "version_tags=" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
|
|
@ -55,11 +69,18 @@ jobs:
|
||||||
flavor: |
|
flavor: |
|
||||||
latest=auto
|
latest=auto
|
||||||
tags: |
|
tags: |
|
||||||
|
# Semver tags from real Git tags
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=semver,pattern={{major}}
|
type=semver,pattern={{major}}
|
||||||
|
|
||||||
|
# Manual input derived tags
|
||||||
|
type=raw,value=${{ env.version_tags }},enable=${{ env.version_tags != '' }}
|
||||||
|
|
||||||
|
# Fallbacks for branches/PRs
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
|
type=ref,event=pr
|
||||||
|
type=sha
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
id: build-and-push
|
id: build-and-push
|
||||||
|
|
@ -73,7 +94,6 @@ jobs:
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
# Sign the published image digest
|
|
||||||
- name: Sign the published Docker image
|
- name: Sign the published Docker image
|
||||||
env:
|
env:
|
||||||
TAGS: ${{ steps.meta.outputs.tags }}
|
TAGS: ${{ steps.meta.outputs.tags }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue