-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Travis CI to Github Actions
- Loading branch information
1 parent
7a3ea3a
commit 293b1a2
Showing
5 changed files
with
53 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ '*' ] | ||
pull_request: | ||
branches: [ '*' ] | ||
|
||
workflow_dispatch: | ||
schedule: | ||
- cron: '30 4 * * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
BGPTOOLS_VERSION: 0.0.3 | ||
GO111MODULE: on | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
- run: sudo apt-get install -y bgpdump build-essential git | ||
- uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-build-dependencies | ||
path: | | ||
~/go/bin | ||
- run: ./dependency.sh | ||
- run: ./generate.sh | ||
- run: ./stat.sh | ||
- run: ./guard.sh | ||
- name: Checkout ip-lists branch | ||
uses: actions/checkout@v3 | ||
if: github.event_name == 'schedule' && github.ref == 'refs/heads/master' | ||
with: | ||
ref: ip-lists | ||
path: ip-lists | ||
- run: ./upload.sh | ||
if: github.event_name == 'schedule' && github.ref == 'refs/heads/master' |
This file was deleted.
Oops, something went wrong.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
[[ $(wc -l result/china.txt) < 3000 ]] && exit 1 | ||
|
||
[[ $(wc -l result/china6.txt) < 1000 ]] && exit 2 | ||
|
||
exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
git clone -b ip-lists https://${GH_REF} ip-lists | ||
rm ip-lists/*.txt | ||
mv result/* ip-lists | ||
cd ip-lists | ||
git config user.name $GIT_USER_NAME | ||
git config user.email $GIT_USER_EMAIL | ||
git config user.name Github Actions | ||
git config user.email github-actions@github.com | ||
git add . | ||
git commit -m "update $(date +%Y-%m-%d)" | ||
git push -q "https://${GH_TOKEN}@${GH_REF}" ip-lists:ip-lists | ||
git push -q "https://${GH_TOKEN}@${GH_REF}" ip-lists:gh-pages | ||
git push -q | ||
|