-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (62 loc) · 2.12 KB
/
Copy pathrun.yml
File metadata and controls
71 lines (62 loc) · 2.12 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
name: Goat / Floppa Bot Runner
on:
workflow_dispatch:
inputs:
node_version:
description: 'Node.js version'
required: false
type: choice
options:
- '22'
- '20'
default: '20'
jobs:
build-and-run:
name: Run Floppa Bot Runner
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: 'true'
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version || '20' }}
- name: Install System Native Build Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
- name: Cache Node Modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm install --include=optional && (npm rebuild sqlite3 canvas bcrypt 2>/dev/null || true)
- name: Configure Credentials If Provided
env:
FB_STATE: ${{ secrets.FB_STATE }}
ACCOUNT_TXT: ${{ secrets.ACCOUNT_TXT }}
run: |
if [ -n "$FB_STATE" ]; then
printf '%s\n' "$FB_STATE" > account.txt
echo "Loaded Facebook credentials from FB_STATE secret."
elif [ -n "$ACCOUNT_TXT" ]; then
printf '%s\n' "$ACCOUNT_TXT" > account.txt
echo "Loaded Facebook credentials from ACCOUNT_TXT secret."
fi
if [ -s account.txt ]; then
echo "account.txt is present and configured ($(wc -c < account.txt) bytes)"
else
echo "account.txt will be loaded from repository or environment fallback."
fi
- name: Start the Bot
env:
PORT: 5000
NODE_ENV: production
FB_STATE: ${{ secrets.FB_STATE }}
ACCOUNT_TXT: ${{ secrets.ACCOUNT_TXT }}
run: npm start