-
Notifications
You must be signed in to change notification settings - Fork 108
70 lines (59 loc) · 1.98 KB
/
static.yml
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
name: STATIC_DEPLOY
on:
push:
branches:
- dev
paths:
- 'docs/**'
env:
CI: true
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
build:
if: 'contains(github.event.head_commit.message, ''skip'') == false'
name: Build
runs-on: ubuntu-latest
steps:
- name: Get The Code
uses: actions/checkout@v2
- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: 9.3.0
- name: Set Node Version
uses: actions/setup-node@v3
with:
node-version: 22.3.0
cache: pnpm
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: |
pnpm install
pnpm rebuild --recursive
- name: Build Static Assets
run: npm run docs:build
- name: Install FlyCtl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy To Production Apps
run: flyctl deploy . --config ./fly/fiction.docs.toml --remote-only --detach
- name: Post Notification
if: always()
id: slack
uses: slackapi/slack-github-action@v1.24.0
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"icon_emoji": "${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}",
"username": "supereon",
"channel": "#notify",
"text": "Workflow *${{ github.workflow }}* on *${{ github.ref }}* (commit: ${{ github.sha }}) completed with status: *${{ job.status }}*. <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}