Skip to content

Airdrop Updater

Airdrop Updater #7079

Workflow file for this run

# 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