enh: force deploy frontends via github actions

This commit is contained in:
Ben Allfree 2024-02-22 13:48:30 -08:00
parent 16b63b4ba8
commit 469c97d935

View File

@ -1,4 +1,12 @@
on: [push]
on:
push:
pull_request:
workflow_dispatch:
inputs:
force_deploy:
description: 'Force deploy specific project'
required: false
default: ''
jobs:
publish:
@ -12,7 +20,7 @@ jobs:
uses: actions/checkout@v4.1.1
- name: pnpm
uses: pnpm/action-setup@v2.4.0
uses: pnpm/action-setup@v3.0.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
@ -34,6 +42,10 @@ jobs:
# ===================
# DASHBOARD
# ===================
- name: DASHBOARD - Force Deploy Check
id: force-deploy-dashboard
run: echo "::set-output name=force::${{ github.event.inputs.force_deploy == 'dashboard' }}"
- name: DASHBOARD - Get changed dashboard files
id: changed-dashboard-files
uses: tj-actions/changed-files@v40.1.0
@ -43,7 +55,7 @@ jobs:
- name: DASHBOARD - Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1.5.0
if: steps.changed-dashboard-files.outputs.any_changed == 'true'
if: steps.changed-dashboard-files.outputs.any_changed == 'true' || steps.force-deploy-dashboard.outputs.force == 'true'
id: dashboard_deploy
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@ -55,7 +67,7 @@ jobs:
wranglerVersion: '3'
- name: DASHBOARD - Discord feature branch notification
if: github.ref_name != 'master' && steps.changed-dashboard-files.outputs.any_changed == 'true'
if: github.ref_name != 'master' && (steps.changed-dashboard-files.outputs.any_changed == 'true' || steps.force-deploy-dashboard.outputs.force == 'true')
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
@ -63,7 +75,7 @@ jobs:
args: '**DASHBOARD 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: DASHBOARD - Discord live branch notification
if: github.ref_name == 'master' && steps.changed-dashboard-files.outputs.any_changed == 'true'
if: github.ref_name == 'master' && (steps.changed-dashboard-files.outputs.any_changed == 'true' || steps.force-deploy-dashboard.outputs.force == 'true')
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
@ -73,6 +85,11 @@ jobs:
# ===================
# LANDER
# ===================
- name: LANDER - Force Deploy Check
id: force-deploy-lander
run: echo "::set-output name=force::${{ github.event.inputs.force_deploy == 'lander' }}"
- name: LANDER - Get changed files
id: changed-lander-files
uses: tj-actions/changed-files@v40.1.0
@ -82,7 +99,7 @@ jobs:
- name: LANDER - Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1.5.0
if: steps.changed-lander-files.outputs.any_changed == 'true'
if: steps.changed-lander-files.outputs.any_changed == 'true' || steps.force-deploy-lander.outputs.force == 'true'
id: lander_deploy
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@ -94,7 +111,7 @@ jobs:
wranglerVersion: '3'
- name: LANDER - Discord feature branch notification
if: github.ref_name != 'master' && steps.changed-lander-files.outputs.any_changed == 'true'
if: github.ref_name != 'master' && (steps.changed-lander-files.outputs.any_changed == 'true' || steps.force-deploy-lander.outputs.force == 'true')
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
@ -102,7 +119,7 @@ jobs:
args: '**LANDER 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: LANDER - Discord live branch notification
if: github.ref_name == 'master' && steps.changed-lander-files.outputs.any_changed == 'true'
if: github.ref_name == 'master' && (steps.changed-lander-files.outputs.any_changed == 'true' || steps.force-deploy-lander.outputs.force == 'true')
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
@ -112,6 +129,10 @@ jobs:
# ===================
# SUPERADMIN
# ===================
- name: LANDER - Force Deploy Check
id: force-deploy-superadmin
run: echo "::set-output name=force::${{ github.event.inputs.force_deploy == 'superadmin' }}"
- name: SUPERADMIN - Get changed files
id: changed-superadmin-files
uses: tj-actions/changed-files@v40.1.0
@ -121,7 +142,7 @@ jobs:
- name: SUPERADMIN - Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1.5.0
if: steps.changed-superadmin-files.outputs.any_changed == 'true'
if: steps.changed-superadmin-files.outputs.any_changed == 'true' || steps.force-deploy-superadmin.outputs.force == 'true'
id: superadmin_deploy
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@ -133,7 +154,7 @@ jobs:
wranglerVersion: '3'
- name: SUPERADMIN - Discord feature branch notification
if: github.ref_name != 'master' && steps.changed-superadmin-files.outputs.any_changed == 'true'
if: github.ref_name != 'master' && (steps.changed-superadmin-files.outputs.any_changed == 'true' || steps.force-deploy-superadmin.outputs.force == 'true')
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
@ -141,7 +162,7 @@ jobs:
args: '**SUPERADMIN PREVIEW** ${{ steps.superadmin_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: SUPERADMIN - Discord live branch notification
if: github.ref_name == 'master' && steps.changed-superadmin-files.outputs.any_changed == 'true'
if: github.ref_name == 'master' && (steps.changed-superadmin-files.outputs.any_changed == 'true' || steps.force-deploy-superadmin.outputs.force == 'true')
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master