Skip to content

Commit

Permalink
Introduce GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddosaurus committed Apr 6, 2023
1 parent 7122325 commit bf90f31
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/push-networks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build external-network-pusher

on:
schedule:
- cron: 30 19 * * * # Run this every day at 19:30 UTC


jobs:
build-and-upload:
name: Build external-network-pusher
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Read Go version from go.mod
run: echo "GO_VERSION=$(grep -E "^go\s+[0-9.]+$" go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Go Build Cache
uses: actions/cache@v3
with:
path: ~/.cache
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}

- name: Go Mod Cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}

- name: Run unit tests
run: make test

- name: Build binaries
run: make build

- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: bin
path: .gobin


run-and-upload:
runs-on: ubuntu-latest
needs: build-and-upload
name: Run external-network-pusher and upload results
steps:

- name: Download executable
uses: actions/download-artifact@v3
with:
name: bin

- name: Set permissions to file
run: chmod +x linux/network-crawler

- name: Run external-network-pusher
run: linux/network-crawler --dry-run --bucket-name 123
continue-on-error: false


0 comments on commit bf90f31

Please sign in to comment.