build #1027
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
# This is a basic workflow to help you get started with Actions | |
name: build | |
# Controls when the workflow will run | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 20 * * *" | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: Set time zone | |
run: sudo timedatectl set-timezone 'Asia/Shanghai' | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=datetime::$(date +'%Y-%m-%d-%H-%M-%S')" | |
# Runs a single command using the runners shell | |
- name: make publish dir | |
run: mkdir /home/runner/work/publish | |
# Runs a set of commands using the runners shell | |
- name: build gfwlist | |
run: | | |
date '+%F %T' | |
sh gfwlist2dnsmasq_lite.sh gen | |
sh gfwlist2dnsmasq.sh gen | |
# Runs a set of commands using the runners shell | |
- name: build ipcidr | |
run: | | |
sh ip4cidr2ipset.sh | |
ls -lah /home/runner/work/publish/ | |
- name: git push | |
run: | | |
cd /home/runner/work/publish/ || exit 1 | |
git init | |
git config user.name suzukua_bot | |
git config user.email suzukua_bot | |
git checkout -b hidden | |
git add . | |
git commit -m "Automated build" | |
git remote add hidden "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" | |
git push -f hidden hidden | |
- name: push to Gitlab | |
run: | | |
cd /home/runner/work/publish/ || exit 1 | |
git push -f https://${{ secrets.GITLAB_USERNAME }}:${{ secrets.GITLAB_TOKEN }}@gitlab.com/suzukua/gfwlist2dnsmasq.git HEAD:main |