mirror of
https://github.com/pockethost/pockethost.git
synced 2026-02-27 05:23:18 +00:00
88 lines
4.4 KiB
YAML
88 lines
4.4 KiB
YAML
on: [push]
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
deployments: write
|
|
name: Publish to Cloudflare Pages
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Get changed lander files
|
|
id: changed-lander-files
|
|
uses: tj-actions/changed-files@v35
|
|
with:
|
|
files: |
|
|
dist/lander/**
|
|
|
|
- name: Get changed dashboard files
|
|
id: changed-dashboard-files
|
|
uses: tj-actions/changed-files@v35
|
|
with:
|
|
files: |
|
|
dist/dashboard/**
|
|
|
|
- name: Publish lander to Cloudflare Pages
|
|
uses: cloudflare/pages-action@v1
|
|
if: steps.changed-lander-files.outputs.any_changed == 'true'
|
|
id: lander_deploy
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
projectName: pockethost
|
|
directory: ./dist/lander
|
|
branch: ${{ github.head_ref || github.ref_name }}
|
|
wranglerVersion: '3'
|
|
|
|
- name: Publish dashboard to Cloudflare Pages
|
|
uses: cloudflare/pages-action@v1
|
|
if: steps.changed-dashboard-files.outputs.any_changed == 'true'
|
|
id: dashboard_deploy
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
projectName: pockethost-dashboard
|
|
directory: ./dist/dashboard
|
|
branch: ${{ github.head_ref || github.ref_name }}
|
|
wranglerVersion: '3'
|
|
|
|
- name: Expose git commit data
|
|
uses: rlespinasse/git-commit-data-action@v1
|
|
|
|
- name: Discord feature branch notification for dashboard
|
|
if: github.ref_name != 'master' && steps.changed-dashboard-files.outputs.any_changed == 'true'
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
uses: Ilshidur/action-discord@master
|
|
with:
|
|
args: '**PREVIEW** ${{ steps.dashboard_deploy.outputs.url }} was generated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }}) with memo `${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}`'
|
|
|
|
- name: Discord feature branch notification for lander
|
|
if: github.ref_name != 'master' && steps.changed-lander-files.outputs.any_changed == 'true'
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
uses: Ilshidur/action-discord@master
|
|
with:
|
|
args: '**PREVIEW** ${{ steps.lander_deploy.outputs.url }} was generated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }}) with memo `${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}`'
|
|
|
|
- name: Discord live branch notification for dashboard
|
|
if: github.ref_name == 'master' && steps.changed-dashboard-files.outputs.any_changed == 'true'
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
uses: Ilshidur/action-discord@master
|
|
with:
|
|
args: '**LIVE** https://app.pockethost.io ([permalink](${{ steps.dashboard_deploy.outputs.url }})) was updated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }}): `${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}`'
|
|
|
|
- name: Discord live branch notification for lander
|
|
if: github.ref_name == 'master' && steps.changed-lander-files.outputs.any_changed == 'true'
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
uses: Ilshidur/action-discord@master
|
|
with:
|
|
args: '**LIVE** https://pockethost.io ([permalink](${{ steps.lander_deploy.outputs.url }})) was updated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }}): `${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}`'
|