Build and deploy #24
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: Build and deploy | |
run-name: Build and deploy | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 10 * * *' | |
permissions: | |
contents: write | |
jobs: | |
test: | |
uses: ./.github/workflows/test_functions.yml | |
# This condition lets the job run even if any of the previous jobs failed | |
# ${{ ! cancelled() }} | |
# This condition prevents the job from running if the test job failed | |
# ${{ needs.test.result == 'success' }} | |
build: | |
needs: [test] | |
uses: ./.github/workflows/retrieve_domains.yml | |
secrets: inherit | |
prune-dead: | |
needs: [test, build] | |
if: ${{ ! cancelled() && needs.test.result == 'success' }} | |
uses: ./.github/workflows/check_dead.yml | |
prune-parked: | |
needs: [test, prune-dead] | |
if: ${{ ! cancelled() && needs.test.result == 'success' }} | |
uses: ./.github/workflows/check_parked.yml | |
validate: | |
needs: [test, prune-parked] | |
if: ${{ ! cancelled() && needs.test.result == 'success' }} | |
uses: ./.github/workflows/validate_domains.yml | |
secrets: inherit | |
deploy: | |
needs: [test, validate] | |
if: ${{ ! cancelled() && needs.test.result == 'success' }} | |
uses: ./.github/workflows/build_lists.yml | |
prune-logs: | |
needs: deploy | |
if: ${{ ! cancelled() }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Prune logs | |
run: | | |
bash functions/tools.sh --prune-lines config/domain_log.csv 20000 | |
bash functions/tools.sh --prune-lines config/source_log.csv 10000 | |
- name: Push | |
run: | | |
git config user.email ${{ vars.GIT_EMAIL }} | |
git config user.name ${{ vars.GIT_USERNAME }} | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Prune logs" | |
git push -q | |
update-readme: | |
needs: [deploy, prune-logs] | |
# Run only if deployment was successful | |
if: ${{ ! cancelled() && needs.deploy.result == 'success' }} | |
uses: ./.github/workflows/update_readme.yml |