Update copy.yml #28
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 Domain | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
copy_domains: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
ref: 2024 | |
- name: Set up Git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
git remote set-url origin "https://${{ secrets.GH_TOKEN }}@github.com/lepasid/blocklist.git" | |
- name: Set up time zone | |
run: export TZ=Asia/Jakarta | |
- name: Update Domains | |
run: | | |
FILE_NAME=$(date +"%Y-%m-%d") | |
if [ -e "$FILE_NAME" ]; then | |
rm "$FILE_NAME" | |
fi | |
git checkout main -- domains | |
mv domains "$FILE_NAME" | |
git add "$FILE_NAME" | |
git commit -m "Update on $FILE_NAME" | |
git push -u origin 2024 |