-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (59 loc) · 1.81 KB
/
publish.yaml
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
# This workflow will push to surge.sh
#
# To make it work, you need a dev.to API key, see:
# https://developers.forem.com/api/#section/Authentication/api_key
#
# Once you have generated the token, you need to add them as a secret in your
# GitHub repository:
# - DEVTO_TOKEN: your dev.to API key
# See https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets
# for more information about GitHub secrets.
name: publish
on:
push:
branches: [main]
# pull_request:
# branches: [main]
jobs:
# build:
# name: Build
# if: github.event_name == 'pull_request'
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [18]
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node-version }}
# cache: yarn
# - run: yarn
# - name: Install textlint
# run: 'yarn add -D textlint textlint-rule-common-misspellings textlint-rule-spellchecker'
# - name: Run textlint
# run: npx textlint -f checkstyle "posts/**/*.md" >> .textlint.log
# - name: Run Prettier
# run: yarn run prettier:check
# - name: Run Embedme
# run: yarn run embedme:check
publish:
name: publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: Install dependencies
run: |
npm i -g surge
npm ci
- name: Build and Deploy to Surge
run: |
npm run build
surge ./build ${{ secrets.SURGE_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }}