-
-
Notifications
You must be signed in to change notification settings - Fork 9
114 lines (93 loc) · 3.36 KB
/
airdrop.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Airdrop Updater
on:
push:
branches:
- master
schedule:
- cron: "30 3-10 * * *"
env:
BOT_TOKEN: ${{ secrets.BOTTOKEN }}
CHANNEL_ID: ${{ secrets.CHANNELID }}
LOGIN_KEY: ${{ secrets.MAINPRIVATEKEY }}
DATABASE_USER: ${{ secrets.DATABASEUSER }}
DATABASE_PASSWORD: ${{ secrets.DATABASEPASS }}
MQTT_TOPIC: ${{ secrets.MQTT_TOPIC }}
jobs:
master:
runs-on: ubuntu-latest
outputs:
today: ${{ steps.day.outputs.day }}
steps:
- name: Get current day
id: day
run: echo "::set-output name=day::$(date +'%A')"
main:
needs: master
if: ${{ needs.master.outputs.today == 'Monday' }}
runs-on: ubuntu-latest
steps:
- run: echo "it's ${{ needs.master.outputs.today }}, let's fcking go...."
- uses: actions/checkout@v2
- uses: c-hive/gha-npm-cache@v1
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- name: Install curl dependencies
run: sudo apt-get install -y libnss3 nss-plugin-pem ca-certificates
- name: add premission to curl
run: sudo chmod 755 $GITHUB_WORKSPACE/curl/curl_impersonate && sudo chmod 755 $GITHUB_WORKSPACE/curl/curl-impersonate-chrome
- name: Install NPM Package
run: npm install
- name: Update Airdrop Data
run: node airdrop.js
- name: Update Airdrop Status
run: node status.js
- name: Update Telegram
run: node telegram.js
- name: Update Last Check
run: TZ='Asia/Jakarta' date +%c > lastCheck
- name: Push LogFile
run: |
git config --global user.name 'Airdrop Updater'
git config --global user.email '[email protected]'
git add .
git commit -am "Airdrop Check"
git push
secondary:
needs: master
if: ${{ needs.master.outputs.today != 'Monday' }}
runs-on: ubuntu-latest
steps:
- run: echo "it's ${{ needs.master.outputs.today }}, nevermind...."
- uses: actions/checkout@v2
- uses: c-hive/gha-npm-cache@v1
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- name: Install curl dependencies
run: sudo apt-get install -y libnss3 nss-plugin-pem ca-certificates
- name: add premission to curl
run: sudo chmod 755 $GITHUB_WORKSPACE/curl/curl_impersonate && sudo chmod 755 $GITHUB_WORKSPACE/curl/curl-impersonate-chrome
- name: Install NPM Package
run: npm install
- name: Update Airdrop Data
run: node airdrop.js
- name: Update Airdrop Status
run: node status.js
- name: Update Telegram
run: node telegram.js
- name: Update Last Check
run: TZ='Asia/Jakarta' date +%c > lastCheck
- name: Push LogFile
run: |
git config --global user.name 'Airdrop Updater'
git config --global user.email '[email protected]'
git add .
git commit -am "Airdrop Check"
git push