Generate-Netflix-CI #2078
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: Generate-Netflix-CI | |
on: | |
schedule: | |
- cron: 0 16 * * * | |
watch: | |
types: [started] | |
#push: | |
# branches: | |
# - master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.repository.owner.id == github.event.sender.id || ! github.event.sender.id | |
steps: | |
- uses: actions/checkout@master | |
- name: Init build dependencies | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo -E apt-get update -y | |
sudo -E apt-get install -y aggregate whois jq | |
- name: Run generate script | |
env: | |
LICENSE_KEY: ${{ secrets.LICENSE_KEY }} | |
run: | | |
chmod +x ./netflix_iprange.sh | |
bash ./netflix_iprange.sh | |
rm -f ./update.txt | |
chmod +x ./mapcidr | |
./mapcidr -cl ./NF_only.txt -o ./NOTMP.txt -a | |
cat ./NOTMP.txt > ./NF_only.txt | |
rm -f ./NOTMP.txt | |
./mapcidr -cl ./getflix.txt -o ./NOTMP.txt -a | |
cat ./NOTMP.txt > ./getflix.txt | |
rm -f ./NOTMP.txt | |
echo `date +%Y/%m/%d\ %H:%M:%S\ %Z` >> ./update.txt | |
- name: Commit file | |
run: | | |
git config --global user.email simonsqiu@foxmail.com | |
git config --global user.name SimonsQiu | |
git add . | |
git commit -m "Update `date +%Y/%m/%d\ %H:%M:%S\ %Z`" -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{secrets.GITHUB_TOKEN}} | |
- name: Cleanup Workflow Logs | |
uses: Mattraks/delete-workflow-runs@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
retain_days: 1 |