Doctolib center scrap #30439
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: Doctolib center scrap | |
env: | |
DOCTOLIB_API_KEY: ${{ secrets.DOCTOLIB_API_KEY }} | |
VPN_CONFIG: ${{ secrets.VPN_CONFIG }} | |
VPN_CONNECT: ${{ secrets.VPN_CONNECT }} | |
on: | |
schedule: | |
- cron: "0 * * * *" | |
# Allow running manually | |
workflow_dispatch: | |
jobs: | |
scrape: | |
name: "Doctolib center scrap" | |
runs-on: "ubuntu-20.04" | |
steps: | |
- uses: "actions/checkout@v2" | |
with: | |
token: ${{ secrets.PAT_GRZ }} | |
- uses: "actions/setup-python@v2" | |
with: | |
python-version: "3.8" | |
- name: "Install" | |
run: make install | |
- name: Install Open VPN and config files | |
run: | | |
sudo apt-get install openvpn | |
mkdir ~/.ssh | |
pwd | |
ls | |
sudo echo "$VPN_CONFIG" >> config.ovpn | |
sudo echo "$VPN_CONNECT" >> auth.txt | |
- name: Connect VPN | |
run: sudo openvpn --config config.ovpn --auth-user-pass auth.txt --daemon | |
- name: Check VPN | |
run: | | |
sleep 30 | |
echo ${{ steps.connect_vpn.outputs.STATUS }} | |
curl https://ipecho.net/plain | |
- name: "Doctolib scrap..." | |
run: make doctoscrap | |
- name: "Copy output file" | |
run: cp data/output/doctolib-centers.json . | |
- name: "Get folder from data-auto" | |
run: | | |
git clone --branch data-auto https://github.com/CovidTrackerFr/vitemadose.git tmp/ | |
cp -R tmp/data/output/* data/output | |
rm -rf tmp/ | |
cp doctolib-centers.json doctolib_center_list.json | |
cp doctolib-centers.json doctolib_center_list.json data/output | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Updated Doctolib centers | |
push_options: '--force HEAD:data-auto' |