bunkerized-nginx/.github/workflows/push-github.yml

97 lines
3.3 KiB
YAML
Raw Normal View History

name: Push on GitHub (REUSABLE)
on:
workflow_call:
inputs:
VERSION:
required: true
type: string
PRERELEASE:
required: true
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout
- uses: actions/checkout@v3
# Get PDF doc
- name: Get documentation
if: inputs.VERSION != 'testing'
uses: actions/download-artifact@v3
with:
name: BunkerWeb_documentation_v${{ inputs.VERSION }}.pdf
# Create tag
- uses: rickstaa/action-create-tag@v1
name: Create tag
if: inputs.VERSION != 'testing'
with:
tag: "v${{ inputs.VERSION }}"
message: "v${{ inputs.VERSION }}"
force_push_tag: true
2023-08-15 11:40:05 +02:00
# Create tag
- uses: rickstaa/action-create-tag@v1
name: Create tag
if: inputs.VERSION == 'testing'
2023-08-15 11:40:05 +02:00
with:
tag: "${{ inputs.VERSION }}"
message: "${{ inputs.VERSION }}"
force_push_tag: true
# Extract changelog
- name: Extract changelog
if: inputs.VERSION != 'testing'
id: getchangelog
run: |
content=$(awk -v n=2 '/##/{n--}; n > 0' CHANGELOG.md | grep -v '# Changelog' | grep -v '##' | sed '/^$/d')
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
echo "::set-output name=content::$content"
# Create release
- name: Create release
if: inputs.VERSION != 'testing'
uses: softprops/action-gh-release@v1
with:
body: |
Documentation : https://docs.bunkerweb.io/${{ inputs.VERSION }}/
Docker tags :
- `bunkerity/bunkerweb:${{ inputs.VERSION }}`
- `bunkerity/bunkerweb-scheduler:${{ inputs.VERSION }}`
- `bunkerity/bunkerweb-autoconf:${{ inputs.VERSION }}`
- `bunkerity/bunkerweb-ui:${{ inputs.VERSION }}`
Linux packages : https://packagecloud.io/app/bunkerity/bunkerweb/search?q=${{ inputs.VERSION }}&filter=all&dist=
Changelog :
${{ steps.getchangelog.outputs.content }}
2023-04-29 21:43:26 +02:00
draft: true
prerelease: ${{ inputs.PRERELEASE }}
name: v${{ inputs.VERSION }}
tag_name: v${{ inputs.VERSION }}
discussion_category_name: Announcements
files: BunkerWeb_documentation_v${{ inputs.VERSION }}.pdf
2023-08-15 11:40:05 +02:00
# Create release
- name: Create release
if: inputs.VERSION == 'testing'
2023-08-15 11:40:05 +02:00
uses: softprops/action-gh-release@v1
with:
body: |
**The testing version of BunkerWeb should not be used in production, please use the latest stable version instead.**
Documentation : https://docs.bunkerweb.io/${{ inputs.VERSION }}/
Docker tags :
- `bunkerity/bunkerweb:${{ inputs.VERSION }}`
- `bunkerity/bunkerweb-scheduler:${{ inputs.VERSION }}`
- `bunkerity/bunkerweb-autoconf:${{ inputs.VERSION }}`
- `bunkerity/bunkerweb-ui:${{ inputs.VERSION }}`
Linux packages : https://packagecloud.io/app/bunkerity/bunkerweb/search?q=${{ inputs.VERSION }}&filter=all&dist=
draft: false
prerelease: ${{ inputs.PRERELEASE }}
name: Testing
tag_name: ${{ inputs.VERSION }}