Files
FOSSBilling/.github/workflows/release-docker.yml
Adam Daley f43e07cb64 Add CI job summaries and GHCR package cleanup workflow (#3567)
* Add GHCR package cleanup workflow

* Add job summaries to CI workflows

* Add create-release workflow; update release-docker

* Improve auto-cs-fix workflow: caching and summary

* Use GHCR build-cache image and mirror manifests

* Remove prepare-application-assets action

* Standardize workflow step names and cache image
2026-05-16 17:57:49 +01:00

63 lines
1.8 KiB
YAML

name: Upload Release to Docker Registries
on:
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-dockerhub
cancel-in-progress: false
jobs:
check-latest:
name: 'Check if Release is Latest'
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
is_latest: ${{ steps.compare-latest.outputs.is_latest }}
steps:
- name: 'Get Latest Release Version Tag'
id: get-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
latest_release="$(gh api repos/${{ github.repository }}/releases/latest --jq '.tag_name')"
echo "release=${latest_release}" >> "${GITHUB_OUTPUT}"
- name: 'Check if Current Release Version is Latest'
id: compare-latest
run: |
if [ "${{ github.ref_name }}" = "${{ steps.get-latest.outputs.release }}" ]; then
echo "is_latest=true" >> "${GITHUB_OUTPUT}"
else
echo "is_latest=false" >> "${GITHUB_OUTPUT}"
fi
deploy-release-docker:
name: 'Build and Push Release Image'
permissions:
contents: read
packages: write
needs: [ check-latest ]
uses: ./.github/workflows/docker-build.yml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
target: runtime
cache-scope: cache-release
extract-release-tree: true
release-tree-artifact-name: release-build
meta-images: fossbilling/fossbilling
meta-tags: |
type=semver,pattern={{version}}
type=raw,value=latest,enable=${{ needs.check-latest.outputs.is_latest == 'true' }}
meta-flavor: |
latest=false
build-args: |
FOSSBILLING_VERSION=${{ github.ref_name }}
SENTRY_DSN=${{ vars.SENTRY_DSN }}