Notification:v0.11.0 #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Notification Deploy | |
| run-name: Notification:${{ github.event.inputs.tag_name || github.ref_name }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag_name: | |
| description: 'Tag name to deploy (leave empty to use selected tag/branch)' | |
| required: false | |
| default: '' | |
| release_date: | |
| description: 'Release date (leave empty to use current date)' | |
| required: false | |
| default: '' | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy-update-api: | |
| name: Deploy to Pages | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Get Version | |
| id: get_version | |
| shell: pwsh | |
| run: | | |
| if ("${{ github.event_name }}" -eq "workflow_dispatch") { | |
| $tag = "${{ github.event.inputs.tag_name }}" | |
| if ([string]::IsNullOrWhiteSpace($tag)) { | |
| $tag = "${{ github.ref_name }}" | |
| Write-Host "No tag_name provided, falling back to ref_name: $tag" | |
| } | |
| } else { | |
| $tag = "${{ github.event.release.tag_name }}" | |
| } | |
| if ($tag -notlike "v*") { | |
| Write-Error "Invalid tag name: $tag. Must start with 'v'." | |
| exit 1 | |
| } | |
| $version = $tag -replace "^v", "" | |
| echo "TAG=$tag" >> $env:GITHUB_OUTPUT | |
| echo "VERSION=$version" >> $env:GITHUB_OUTPUT | |
| Write-Host "Tag: $tag" | |
| Write-Host "Version: $version" | |
| - name: Prepare Notification Assets | |
| shell: pwsh | |
| run: | | |
| $version = "${{ steps.get_version.outputs.VERSION }}" | |
| $outputDir = "pages_api" | |
| $releaseDate = "${{ github.event.inputs.release_date }}" | |
| if ([string]::IsNullOrWhiteSpace($releaseDate)) { | |
| .\build\actions\notification_prepare.ps1 ` | |
| -Version "$version" ` | |
| -OutputDir "$outputDir" | |
| } else { | |
| .\build\actions\notification_prepare.ps1 ` | |
| -Version "$version" ` | |
| -OutputDir "$outputDir" ` | |
| -ReleaseDate "$releaseDate" | |
| } | |
| - name: Deploy to Cloudflare Pages | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy pages_api --project-name ${{ secrets.CLOUDFLARE_NOTIFICATION_NAME }} --branch main |