CI #1812
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: CI | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
- name: Setup Python environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12.6 | |
- name: Installing Dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
sudo npm install -g [email protected] | |
sudo npm install -g [email protected] | |
- name: Generate | |
run: | | |
chmod +x ./generate.sh | |
./generate.sh | |
- name: Run Python Program | |
run: ./IMDb.py | |
- name: Prettify files | |
run: | | |
prettier --write . | |
- name: Check for changes | |
id: check_changes | |
run: | | |
if [[ -z $(git status --porcelain) ]]; then | |
echo "changes=false" >> $GITHUB_ENV | |
else | |
echo "changes=true" >> $GITHUB_ENV | |
fi | |
- name: Commit files | |
if: ${{ env.changes == 'true' && github.ref == 'refs/heads/main' }} | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add . | |
git commit -m "Add changes" | |
- name: Push changes | |
if: ${{ env.changes == 'true' && github.ref == 'refs/heads/main' }} | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |