Update external sources #3208
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: Update external sources | |
# Controls when the action will run. | |
on: | |
push: | |
branches: | |
- 'master' | |
schedule: | |
- cron: '54 */4 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
GIT_NAME: '${{ secrets.GIT_NAME }}' | |
GIT_EMAIL: '${{ secrets.GIT_EMAIL }}' | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
jobs: | |
scheduler: | |
name: Trigger action | |
runs-on: '${{ matrix.os }}' | |
strategy: | |
fail-fast: false | |
matrix: | |
python_version: | |
- '3.12' | |
os: | |
- ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@main #Obviously yet another american... | |
name: Clone repository | |
with: | |
token: '${{ secrets.GITHUB_TOKEN }}' | |
# - name: Setup PHP | |
# uses: shivammathur/setup-php@main | |
# with: | |
# php-version: '8.3' | |
# extensions: mysql, imagick | |
- name: Install requirements | |
run: | | |
sudo bash "${{ github.workspace }}/scripts/dependencies.sh" | |
- name: Install mypdns | |
run: | | |
pip install --break-system-packages --no-cache mypdns | |
# - name: Change php mem limit | |
# run: sudo bash "${{ github.workspace }}/scripts/php-limit.sh" | |
# - name: (converter.php) | |
# run: php -f "${{ github.workspace }}/scripts/converter.php" | |
# - name: (urls-to-domains.php) | |
# run: php -f "${{ github.workspace }}/scripts/urls-to-domains.php" | |
- name: import.sh | |
run: bash "${{ github.workspace }}/scripts/import.sh" | |
- name: csv_import.sh | |
run: bash "${{ github.workspace }}/scripts/csv_import.sh" | |
- name: Update active source list | |
run: bash "${{ github.workspace }}/scripts/update_active_lists.sh" | |
- name: Commit changes | |
run: | | |
tag=$(date +'day: %j of year %Y %H:%M:%S') | |
git config --local user.email "$GIT_EMAIL" | |
git config --local user.name "$GIT_NAME" | |
git add . | |
git commit -m "Committed new lists $tag" -a | |
git pull --rebase | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |