Update CopyFIDOKey.yml only push when updated #13
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: Update FidoKeys in gh-pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
copy-file: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
with: | |
ref: main # Replace with your initial branch name | |
- name: Set up Git | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Copy file to gh-pages branch | |
run: | | |
# Check out the gh-pages branch | |
git fetch origin gh-pages | |
git checkout gh-pages | |
# Copy the file from the main branch to the gh-pages branch | |
git checkout main -- Assets/FidoKeys.json | |
mv Assets/FidoKeys.json Explorer/FidoKeys.json | |
# Commit and push the changes | |
git add Explorer/FidoKeys.json | |
git commit -m "Update fidokeys.json from main branch" | |
git push origin gh-pages |