Update from Private Repo #30
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 from Private Repo | |
on: | |
workflow_dispatch: | |
jobs: | |
update-public-repo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout public repository | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Checkout private repository | |
run: | | |
mkdir -p ../priavte-sds-repo | |
git clone https://github.com/access-ci-org/ACCESS-SDS ../private-sds-repo | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
- name: Install rclone | |
run: | | |
curl https://rclone.org/install.sh | sudo bash | |
- name: Sync files | |
run: | | |
rclone sync ../private-sds-repo/ . --exclude='.git/**' --exclude='.github/**' --exclude='README.md' | |
rm -r ../private-sds-repo | |
- name: Commit and push changes | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git commit -m "Update from private repo" | |
git push origin main | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} |