-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (70 loc) · 2.31 KB
/
Copy pathdeploy.yml
File metadata and controls
82 lines (70 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Test & deploy branch to Cloudflare
on:
push:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
jobs:
test-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Build Booyah, and setup for link
run: |
yarn
yarn build
yarn link
working-directory: ./booyah
- name: Build booyah-maquette
run: |
yarn
yarn add maquette
yarn add @play-curious/maquette-advanced-projector
yarn link booyah
yarn build
working-directory: ./booyah-maquette
- name: Install other dependencies
run: yarn
- name: Check types
run: yarn types
- name: Build dist
run: yarn dist
- name: Deploy to Cloudflare
uses: cloudflare/pages-action@v1
id: deploy
with:
apiToken: ${{ secrets.CF_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
gitHubToken: ${{ secrets.GH_DEPLOY_TOKEN }}
projectName: cyberharcelement
directory: ./dist/
- name: Send Discord failure notification
uses: Ilshidur/action-discord@master
if: failure()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: "🚨 Deployment failed on branch `${{ github.head_ref || github.ref_name }}`"
- name: Send Discord success notification
uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: "You can test the deployment of branch `${{ github.head_ref || github.ref_name }}` at ${{ steps.deploy.outputs.url }}"