-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Update Devportal Documentation | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'README.md' | ||
|
||
jobs: | ||
update-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
# Step 1: Clone the Devportal Repository | ||
- name: Clone Devportal Repository | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.DEVPORTAL_TOKEN }} | ||
run: | | ||
git clone https://github.com/rsksmart/devportal.git | ||
cd devportal | ||
git checkout -b update-from-foundry-starter || git checkout update-from-foundry-starter | ||
cd .. | ||
# Step 2: Transform Each File and Copy to Devportal Repository | ||
- name: Transform Files for Devportal | ||
run: | | ||
mkdir -p transformed | ||
# Process README.md | ||
echo "---" > transformed/README.md | ||
echo "sidebar_label: Rootstock Foundry Starter kit" >> transformed/README.md | ||
echo "sidebar_position: 500" >> transformed/README.md | ||
echo "title: Rootstock Foundry Starter kit" >> transformed/README.md | ||
echo "description: 'Whether you are a seasoned developer or just starting your journey into smart contract development, the foundry starter kit provides a solid foundation for building decentralized applications (dApps) on the Rootstock network.'" >> transformed/README.md | ||
echo "tags: [rsk, rootstock, tutorials, developers, foundry, quick starts, dApps, smart contracts]" >> transformed/README.md | ||
echo "---" >> transformed/README.md | ||
echo "" >> transformed/README.md | ||
echo ":::info[Note]" >> transformed/README.md | ||
echo "You can add your suggestion on the [Foundry Starter Kit Repository](https://github.com/rsksmart/rootstock-foundry-starterkit.git)" >> transformed/README.md | ||
echo ":::" >> transformed/README.md | ||
echo "" >> transformed/README.md | ||
cat README.md >> transformed/README.md | ||
cp transformed/README.md devportal/docs/02-developers/04-quickstart/foundry.md | ||
# Step 3: Commit and Push Changes to Devportal Repository | ||
- name: Commit and Push Changes | ||
run: | | ||
cd devportal | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git add docs/02-developers/04-quickstart/foundry.md | ||
git commit -m "Automated update from repository" | ||
git push -f origin update-from-foundry-starter | ||
# Step 4: Create a Pull Request in the Devportal Repository | ||
- name: Create Pull Request | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.DEVPORTAL_TOKEN }} | ||
run: | | ||
cd devportal | ||
curl -L -X POST -H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${{ secrets.DEVPORTAL_TOKEN }}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/rsksmart/devportal/pulls \ | ||
-d '{"title":"Automated update of documentation","body":"This PR updates the Devportal documentation with the latest changes from the original repository.","head":"update-from-foundry-starter","base":"main"}' |