testing bash mode for workflow
This commit is contained in:
@@ -9,28 +9,34 @@ jobs:
|
|||||||
check-weather:
|
check-weather:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Install Python
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y python3 python3-pip python3-venv git
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Checkout repository
|
||||||
uses: actions/setup-python@v5
|
env:
|
||||||
with:
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
python-version: '3.11'
|
SERVER_URL: ${{ github.server_url }}
|
||||||
cache: 'pip'
|
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 -r requirements.txt
|
run: pip install --break-system-packages -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: python -m app.main
|
run: python3 -m app.main
|
||||||
|
|
||||||
- name: Commit state changes
|
- name: Commit state changes
|
||||||
run: |
|
run: |
|
||||||
git config user.name "Gitea Actions"
|
|
||||||
git config user.email "actions@gitea.local"
|
|
||||||
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