Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix github actions error #7

Merged
merged 8 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions .github/workflows/pipeline_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,52 @@ name: run python script

on:
schedule:
- cron: "0 0 * * 0" #runs at 00:00 UTC every Sunday
- cron: "0 0 * * 0" # runs at 00:00 UTC every Sunday
push:
branches:
- dev
pull_request:
branches:
- main

jobs:
manual_deploy:
runs-on: ubuntu-latest

steps:
- name: checkout repo content
- name: Checkout repo content
uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v2
- name: Setup Python
uses: actions/setup-python@v4 # Update to latest version
with:
python-version: 3.10.10 #install the python needed
python-version: 3.10.10
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v2
with:
path: "requirements.txt"
- name: execute py script # run the run.py to get the latest data
run: |
python open_health_stats/run.py
dir
pip install -r requirements.txt
- name: Create necessary directories
run: |
mkdir -p data logs
- name: Execute Python script
run: |
python run.py
- name: Pull latest changes
run: |
git pull origin main
- name: Commit files
id: commit
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git add --all
if [-z "$(git status --porcelain)"]; then
echo "::set-output name=push::false"
if [ -z "$(git status --porcelain)" ]; then
echo "push=false" >> $GITHUB_ENV # Use Environment Files for setting output
else
git commit -m "Add changes" -a
echo "::set-output name=push::true"
echo "push=true" >> $GITHUB_ENV
fi
shell: bash
- name: Push changes
if: steps.commit.outputs.push == 'true'
if: env.push == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
79 changes: 0 additions & 79 deletions create_publication.py

This file was deleted.

Loading
Loading