Build filtrite fork data #832
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: Build filtrite fork data | |
on: | |
push: | |
paths: 'generator/**' | |
schedule: | |
- cron: "0 14 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.15 | |
- name: Download repo | |
uses: actions/checkout@v2 | |
- name: Download dependencies | |
run: | | |
go get -v -t -d ./... | |
working-directory: generator | |
- name: Runnning build/generation script | |
shell: bash | |
run: | | |
go run . | |
working-directory: generator | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
INITIAL_REPO_OWNER: xarantolus | |
INITIAL_REPO_NAME: filtrite | |
OUTPUT_FILE: filterlists_jsonp.js | |
- name: Generate tag name | |
run: echo "TAG_NAME=$(date +%F-%H-%M)" >> $GITHUB_ENV | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: generator/filterlists_jsonp.js | |
name: Automatic generation | |
tag_name: ${{ env.TAG_NAME }} | |
body: "This release contains the latest data for use in the web application. Not really interesting :)" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Delete older releases | |
uses: dev-drprasad/delete-older-releases@v0.1.0 | |
with: | |
keep_latest: 2 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |