ci: Add build script to release workflow (#203) #66
This file contains hidden or 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: dev-portal | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| replicate-file: | |
| runs-on: ubuntu-latest | |
| name: Replicate Readme Files | |
| steps: | |
| - name: Checkout Project A | |
| uses: actions/checkout@v2 | |
| with: | |
| path: ./project | |
| - name: Checkout Project B | |
| uses: actions/checkout@master | |
| with: | |
| repository: Norigin/dev-portal | |
| token: ${{ secrets.NM_GH_TOKEN }} | |
| path: ./dev-portal | |
| - name: Move files | |
| run: | | |
| REPO_NAME=`basename "$PWD"` | |
| echo "Creating folder /docs/$REPO_NAME/" | |
| mkdir -p ./dev-portal/docs/$REPO_NAME/ | |
| rm -rf ./dev-portal/docs/$REPO_NAME/* | |
| cp -R ./project/docs/* ./dev-portal/docs/$REPO_NAME/ | |
| echo "Markdown files moved to /docs/$REPO_NAME/" | |
| mkdir -p ./dev-portal/static/$IMAGES_FOLDER | |
| mkdir -p ./project/$IMAGES_FOLDER | |
| if [[ `ls ./project/$IMAGES_FOLDER` != "" ]] | |
| then | |
| cp -rf ./project/$IMAGES_FOLDER/* ./dev-portal/static/$IMAGES_FOLDER | |
| echo "Images moved to /static/$IMAGES_FOLDER" | |
| fi | |
| - name: Push Project B | |
| run: | | |
| REPO_NAME=`basename "$PWD"` | |
| cd ./dev-portal | |
| if [[ -z $(git status -s) ]] | |
| then | |
| echo "Tree is clean. Nothing to commit" | |
| else | |
| git add . | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git commit -am "Replicated from $REPO_NAME" | |
| git push | |
| exit | |
| fi |