Instagram Automation #1073
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Instagram Automation | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push events but only for the master branch | |
# push: | |
# branches: [ master ] | |
# Triggers the workflow with scheduler | |
schedule: | |
# 00:00 WIB | |
#- cron: '0 17 * * *' | |
# 06:00 WIB | |
#- cron: '0 11 * * *' | |
# 12:00 WIB | |
- cron: '0 05 * * *' | |
# 18:00 WIB | |
#- cron: '0 23 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
start-workflow: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- uses: actions/checkout@v3 | |
# Python | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install facebook-scrapper | |
run: pip install git+https://github.com/kevinzg/facebook-scraper.git | |
shell: bash | |
- name: Run Python script | |
env: | |
COOKIES: '${{ secrets.COOKIES }}' | |
id: get-posts | |
run: | | |
rm results.txt | |
git config user.name dhohirpradana | |
git config user.email [email protected] | |
git fetch origin | |
git reset --hard origin/master | |
git pull | |
python app.py | |
git add results.txt | |
git commit -m "results.txt changes" | |
git push | |
shell: bash | |
# NodeJS | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Install ts-node | |
run: npm install -g ts-node | |
- name: Install dependencies | |
run: npm install | |
- name: Run node script | |
env: | |
IG_USERNAME: '${{ secrets.IG_USERNAME }}' | |
IG_PASSWORD: '${{ secrets.IG_PASSWORD }}' | |
# UNSPLASH_ACCESS_KEY: '${{ secrets.UNSPLASH_ACCESS_KEY }}' | |
QUOTES_API_KEY: '${{ secrets.QUOTES_API_KEY }}' | |
run: ts-node app.ts |