mirror of
https://github.com/pockethost/pockethost.git
synced 2026-03-07 01:21:31 +00:00
enh: Cloudflare Pages SSG publishing
This commit is contained in:
19
.github/workflows/pockethost.yaml
vendored
19
.github/workflows/pockethost.yaml
vendored
@@ -1,19 +0,0 @@
|
||||
name: Node.js CI
|
||||
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: yarn
|
||||
- run: yarn lint
|
||||
48
.github/workflows/publish.yaml
vendored
Normal file
48
.github/workflows/publish.yaml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
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
|
||||
- run: yarn install
|
||||
- run: yarn lint
|
||||
- run: 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/pockethost.io/build
|
||||
branch: ${{ github.head_ref || github.ref_name }}
|
||||
wranglerVersion: '3'
|
||||
|
||||
- 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 }} was generated from [commit ${{ github.sha }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }})'
|
||||
|
||||
- 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 has been updated from [commit ${{ github.sha }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }})'
|
||||
Reference in New Issue
Block a user