ci: test auto fetch #4
Workflow file for this run
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: Fetch data | |
on: | |
push: | |
branches: [dev] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: stable | |
- name: Fetch data | |
run: return 0 | |
- name: Configure git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Commit fetched data | |
id: commit_fetched | |
continue-on-error: true | |
run: | | |
git add src/contests.json public/users.json | |
git commit -m "Fetch data" | |
- name: Push to default branch | |
run: git push | |
- name: Extract user data | |
if: ${{ steps.commit_fetched.outcome == 'success' }} | |
run: go run ./cmd/ex | |
- 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 |