update tag #125
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 tag | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 0 * * 6 | |
env: | |
TZ: Asia/Shanghai | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Initialization environment | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo -E apt-get -qq update | |
sudo -E apt-get -qq install git subversion git-core wget | |
sudo timedatectl set-timezone "$TZ" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
- name: execute | |
run: | | |
cd $GITHUB_WORKSPACE | |
chmod +x UpdateTag.sh | |
git clone https://github.com/Sagit-chu/mosdns-container.git mosdns-container | |
cd mosdns-container | |
$GITHUB_WORKSPACE/UpdateTag.sh | |
- name: Upload | |
env: | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
run: | | |
cd $GITHUB_WORKSPACE/mosdns-container | |
git add . | |
git commit -m "update tag $(TZ='Asia/Shanghai' date +%m-%d" "%H:%M)" | |
git push --quiet "https://${{ secrets.ACCESS_TOKEN }}@github.com/Sagit-chu/mosdns-container.git" HEAD:main | |
- name: Trigger build | |
if: steps.Upload.outputs.cache-hit != 'true' | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.ACCESS_TOKEN }} | |
event-type: Tag Update |