Skip to content

Commit

Permalink
ci: push to dist after auto fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
wxh06 committed Nov 12, 2023
1 parent 53d9466 commit 50bdfb1
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/fetch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,35 @@ jobs:
with:
go-version: stable

- name: Fetch
run: go run ./cmd/fetch

- name: Commit
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Fetch data
run: go run ./cmd/fetch

- name: Commit fetched data
id: commit_fetched
continue-on-error: true
run: |
git add src/contests.json public/users.json
git diff-index --quiet HEAD || git commit -m "Fetch data"
git commit -m "Fetch data"
- name: Push
- name: Push to default branch
if: ${{ steps.commit_fetched.outcome == 'success' }}
run: git push

- name: Extract user data
if: ${{ steps.commit_fetched.outcome == 'success' }}
run: go run ./cmd/extract

- name: Commit extracted user
if: ${{ steps.commit_fetched.outcome == 'success' }}
run: |
git add -f public/users/
git commit -m "Extract user data"
- name: Push to dist
if: ${{ steps.commit_fetched.outcome == 'success' }}
run: git push -f origin main:dist

0 comments on commit 50bdfb1

Please sign in to comment.