Skip to content

Commit

Permalink
chore: add gh actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
invakid404 committed Sep 8, 2022
1 parent deadc5f commit deadace
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/scrape.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Scrape

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"

jobs:
scrape:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.19'

- name: Install Firefox & Geckodriver
run: |
sudo apt update
sudo apt install jq firefox
json=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest)
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux64") and endswith("gz"))')
curl -s -L "$url" | tar -xz
chmod +x geckodriver
sudo mv geckodriver /usr/bin/
ls -la /usr/bin/geckodriver
- name: Scrape
id: scrape
run: |
FIREFOX_BIN=/usr/bin/firefox go run .
- name: Check for existing tag
uses: mukunku/[email protected]
id: check-tag
with:
tag: ${{ steps.scrape.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create release
uses: ncipollo/release-action@v1
if: ${{ steps.check-tag.outputs.exists == 'false' }}
with:
artifacts: ${{ steps.scrape.outputs.path }}
artifactErrorsFailBuild: true
tag: ${{ steps.scrape.outputs.version }}

0 comments on commit deadace

Please sign in to comment.