mirror of
https://github.com/pockethost/pockethost.git
synced 2025-11-23 22:15:49 +00:00
67 lines
2.8 KiB
YAML
67 lines
2.8 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: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20.x
|
|
|
|
- name: Prepare build
|
|
run: |
|
|
yarn install
|
|
yarn lint
|
|
yarn build
|
|
|
|
- name: Publish www to Cloudflare Pages
|
|
uses: cloudflare/pages-action@v1
|
|
id: www_deploy
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
projectName: pockethost
|
|
directory: ./packages/www/_site
|
|
branch: ${{ github.head_ref || github.ref_name }}
|
|
wranglerVersion: '3'
|
|
|
|
- name: Publish dashboard to Cloudflare Pages
|
|
uses: cloudflare/pages-action@v1
|
|
id: dashboard_deploy
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
projectName: pockethost-dashboard
|
|
directory: ./packages/dashboard/build
|
|
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
|
|
if: github.ref_name != 'master'
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
uses: Ilshidur/action-discord@master
|
|
with:
|
|
args: '**PREVIEW** ${{ steps.www_deploy.outputs.url }} and ${{ steps.dashboard_deploy.outputs.url }} were 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
|
|
if: github.ref_name == 'master'
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
uses: Ilshidur/action-discord@master
|
|
with:
|
|
args: '**LIVE** https://pockethost.io ([permalink](${{ steps.www_deploy.outputs.url }})) and https://app.pockethost.io ([permalink](${{ steps.dashboard_deploy.outputs.url }})) were 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 }}'
|