-
Notifications
You must be signed in to change notification settings - Fork 18
46 lines (36 loc) · 1.57 KB
/
sitemapcheck.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Daily sitemap checks
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m venv venv
pip install -r workflows/actions/sitemapcheck/requirements.txt
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
- name: Run Python script
run: |
python workflows/actions/sitemapcheck/check_sitemap_loop.py -s https://raw.githubusercontent.com/iodepo/odis-arch/master/collection/config/production-sources.yaml -f workflows/output/${{ steps.date.outputs.date }}_production_sitemaps.csv
python workflows/actions/sitemapcheck/check_sitemap_loop.py -s https://raw.githubusercontent.com/iodepo/odis-arch/master/collection/config/dev-sources.yaml -f workflows/output/${{ steps.date.outputs.date }}_dev_sitemaps.csv
- name: Add new files to Git
run: |
git config --global user.email "github-actions@example.com"
git config --global user.name "GitHub Actions"
git add workflows/output/${{ steps.date.outputs.date }}_production_sitemaps.csv workflows/output/${{ steps.date.outputs.date }}_dev_sitemaps.csv
git commit -m "Latest SitemapCheck results"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}