fix: preview-web can't be run on forks #1
This file contains 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: release | ||
on: | ||
workflow_run: | ||
workflows: | ||
- build-app-and-preview | ||
branches: main | ||
types: | ||
- completed | ||
release-web-prod: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch compiled source | ||
uses: dawidd6/action-download-artifact@v5 | ||
with: | ||
run_id: ${{ github.event.workflow_run.id }} | ||
name: compiled-ubuntu-20.04 | ||
path: build | ||
- name: Publish | ||
uses: cloudflare/pages-action@1 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
projectName: buddy | ||
directory: build/renderer | ||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | ||
release-app: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch binaries | ||
uses: dawidd6/action-download-artifact@v5 | ||
with: | ||
run_id: ${{ github.event.workflow_run.id }} | ||
pattern: app-builds-* | ||
path: app-builds | ||
merge-multiple: true | ||
- name: Release latest build | ||
if: startsWith(github.ref, 'refs/tags/v') != true | ||
uses: marvinpinto/action-automatic-releases@4edd7a5aabb1bc62e6dc99b3302d587bf3134e20 | ||
with: | ||
title: "Latest Build" | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
files: app-builds/* | ||
automatic_release_tag: "latest" | ||
prerelease: true | ||
- name: Release tagged build | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: marvinpinto/action-automatic-releases@4edd7a5aabb1bc62e6dc99b3302d587bf3134e20 | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
files: app-builds/* | ||
prerelease: false |