Added checkout before copy

This commit is contained in:
Hugo Bernier 2024-03-24 16:55:25 -04:00 committed by GitHub
parent 69c27816f3
commit 3efb7b533e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 14 deletions

View File

@ -38,21 +38,22 @@ jobs:
commit_message: 'Update samples.json'
file_pattern: samples.json
push_options: '--force'
- name: Checkout gh-pages branch
run: |
git fetch
git checkout gh-pages
- name: Copy samples.json to gh-pages branch
run: cp samples.json ./samples.json
- name: Checkout main branch
uses: actions/checkout@v2
with:
ref: 'main'
path: 'main'
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: 'gh-pages'
path: 'gh-pages'
- name: Copy samples.json to gh-pages branch
run: cp main/samples.json gh-pages/samples.json
# - name: Commit samples.json to gh-pages branch
# run: |
# git config --local user.email "${{ secrets.USER_EMAIL }}"
# git config --local user.name "${{ secrets.USER_NAME }}"
# git add ./samples.json
# git commit -m "Update samples.json in gh-pages branch"
# git push origin gh-pages
- name: Commit to gh-pages branch
uses: stefanzweifel/git-auto-commit-action@v4