mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-09 05:24:58 +09:00
60 lines
1.9 KiB
YAML
60 lines
1.9 KiB
YAML
name: Upload Release to Docker Hub
|
|
|
|
on:
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
jobs:
|
|
release-build:
|
|
name: 'Create Release (${{ github.ref_name }})'
|
|
permissions:
|
|
contents: read
|
|
uses: ./.github/workflows/release-build.yml
|
|
with:
|
|
artifact-name: 'release-build'
|
|
preview: false
|
|
|
|
# Latest release is identified by branch/tag SemVer,
|
|
# not the 'Set as the latest release' GitHub option.
|
|
check-latest:
|
|
name: 'Check if Release is Latest'
|
|
permissions:
|
|
contents: read
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
is_latest: ${{ steps.compare-latest.outputs.is_latest }}
|
|
steps:
|
|
- name: 'Get Latest Release Version Tag'
|
|
id: get-latest
|
|
uses: pozetroninc/github-action-get-latest-release@53d33d213ee71c72360e3c829caf7cee94ec21e2 # master
|
|
with:
|
|
excludes: 'prerelease,draft'
|
|
repository: 'FOSSBilling/FOSSBilling'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- 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 to Docker Hub'
|
|
permissions:
|
|
contents: read
|
|
actions: write
|
|
needs: [ release-build, check-latest ]
|
|
uses: FOSSBilling/.workflows/.github/workflows/docker-build-push.yml@76b4af76fb2a1a2b553ec1c2839044984299a271
|
|
secrets:
|
|
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
with:
|
|
download-artifact: 'release-build'
|
|
platforms: '["linux/amd64", "linux/arm64"]'
|
|
repository-name: 'fossbilling/fossbilling'
|
|
tag-latest: ${{ needs.check-latest.outputs.is_latest }}
|