fixing workflow to use python and installing node there
This commit is contained in:
@@ -8,35 +8,32 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
check-weather:
|
check-weather:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: python:3.11-slim
|
||||||
|
timeout-minutes: 15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install Python
|
- name: Install Node.js (required for actions)
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update && apt-get install -y nodejs git
|
||||||
apt-get install -y python3 python3-pip python3-venv git
|
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
env:
|
uses: actions/checkout@v4
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
SERVER_URL: ${{ github.server_url }}
|
|
||||||
REPOSITORY: ${{ github.repository }}
|
|
||||||
run: |
|
|
||||||
SERVER_HOST="${SERVER_URL#https://}"
|
|
||||||
SERVER_HOST="${SERVER_HOST#http://}"
|
|
||||||
git clone --depth 1 "https://oauth2:${GITEA_TOKEN}@${SERVER_HOST}/${REPOSITORY}.git" .
|
|
||||||
git config user.name "Gitea Actions"
|
|
||||||
git config user.email "actions@gitea.local"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pip install --break-system-packages -r requirements.txt
|
run: pip install -r requirements.txt
|
||||||
|
|
||||||
- name: Run weather alerts
|
- name: Run weather alerts
|
||||||
env:
|
env:
|
||||||
VISUALCROSSING_API_KEY: ${{ secrets.VISUALCROSSING_API_KEY }}
|
VISUALCROSSING_API_KEY: ${{ secrets.VISUALCROSSING_API_KEY }}
|
||||||
NTFY_ACCESS_TOKEN: ${{ secrets.NTFY_ACCESS_TOKEN }}
|
NTFY_ACCESS_TOKEN: ${{ secrets.NTFY_ACCESS_TOKEN }}
|
||||||
run: python3 -m app.main
|
run: python -m app.main
|
||||||
|
|
||||||
- name: Commit state changes
|
- name: Commit state changes
|
||||||
run: |
|
run: |
|
||||||
|
git config --global user.name "Gitea Actions"
|
||||||
|
git config --global user.email "actions@gitea.local"
|
||||||
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
git add data/state.json
|
git add data/state.json
|
||||||
git diff --staged --quiet || git commit -m "chore: update weather alert state [skip ci]"
|
git diff --staged --quiet || git commit -m "chore: update weather alert state [skip ci]"
|
||||||
git push
|
git push
|
||||||
|
|||||||
Reference in New Issue
Block a user