2024-06-20 11:04:30 +00:00
|
|
|
name: Update Site List
|
2023-03-13 10:01:19 +00:00
|
|
|
|
|
|
|
# Trigger the workflow when changes are pushed to the main branch
|
2023-03-13 10:45:44 +00:00
|
|
|
# and the changes include the sherlock/resources/data.json file
|
2023-03-13 10:01:19 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-06-20 11:04:30 +00:00
|
|
|
- master
|
2023-03-13 10:01:19 +00:00
|
|
|
paths:
|
2023-03-13 10:45:44 +00:00
|
|
|
- sherlock/resources/data.json
|
2023-03-13 10:01:19 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
sync-json-data:
|
|
|
|
# Use the latest version of Ubuntu as the runner environment
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
# Check out the code at the specified pull request head commit
|
|
|
|
- name: Checkout code
|
2023-12-12 21:08:25 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-03-13 10:01:19 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-03-29 12:21:57 +00:00
|
|
|
# Install Python 3
|
2023-03-13 10:01:19 +00:00
|
|
|
- name: Install Python
|
2023-12-12 21:08:25 +00:00
|
|
|
uses: actions/setup-python@v5
|
2023-03-13 10:01:19 +00:00
|
|
|
with:
|
2024-06-20 11:04:30 +00:00
|
|
|
python-version: '3.x'
|
2023-03-13 10:01:19 +00:00
|
|
|
|
|
|
|
# Execute the site_list.py Python script
|
2024-05-24 09:50:28 +00:00
|
|
|
- name: Execute site-list.py
|
2024-05-24 10:02:36 +00:00
|
|
|
run: python devel/site-list.py
|
2023-03-13 10:01:19 +00:00
|
|
|
|
2024-06-20 11:04:30 +00:00
|
|
|
- name: Pushes to another repository
|
2024-06-20 11:52:13 +00:00
|
|
|
uses: sdushantha/github-action-push-to-another-repository@main
|
2024-06-20 11:04:30 +00:00
|
|
|
env:
|
|
|
|
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
|
|
|
|
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
|
2023-03-13 10:01:19 +00:00
|
|
|
with:
|
2024-06-20 11:04:30 +00:00
|
|
|
source-directory: 'output'
|
|
|
|
destination-github-username: 'sherlock-project'
|
2024-06-20 11:52:13 +00:00
|
|
|
commit-message: 'Updated site list'
|
2024-06-20 11:04:30 +00:00
|
|
|
destination-repository-name: 'sherlockproject.xyz'
|
|
|
|
user-email: siddharth.dushantha@gmail.com
|
|
|
|
target-branch: master
|