forked from flotiq/flotiq-gatsby-event-1
-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (40 loc) · 1.41 KB
/
deploy.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
name: Deploy Worker
on:
push:
pull_request:
repository_dispatch:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
steps:
- uses: actions/checkout@v2
- name: Use Node.js {{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Check if Flotiq API key is set.
env:
GATSBY_FLOTIQ_API_KEY: ${{ secrets.GATSBY_FLOTIQ_API_KEY }}
run: |
if [ -z "$GATSBY_FLOTIQ_API_KEY" ]; then
echo "Flotiq API Key is not set, using a starter one." && echo "GATSBY_FLOTIQ_API_KEY=40accb088d028cb0779d8fc2ea7646e4" >> $GITHUB_ENV
else
echo "Using user-provided Flotiq API Key. Importing starter data to Flotiq." && echo "GATSBY_FLOTIQ_API_KEY=$GATSBY_FLOTIQ_API_KEY" >> $GITHUB_ENV
npm install -g gatsby-cli
flotiq import . $GATSBY_FLOTIQ_API_KEY
fi
- run: npm install -g flotiq-cli
# - run: flotiq import . $GATSBY_FLOTIQ_API_KEY
- run: yarn install
- run: gatsby build
# env:
# GATSBY_FLOTIQ_API_KEY: ${{ secrets.GATSBY_FLOTIQ_API_KEY }}
- name: Build & Deploy Worker
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}