diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d7f3c69d79a..731b723ab35 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -142,31 +142,45 @@ jobs: git push -f https://$GH_TOKEN@github.com/PalisadoesFoundation/talawa-api.git HEAD:automated-docs echo -e "🚀${Green} Hurrah! doc updated${NoColor}" env: - ACCESS_TOKEN: ${{ secrets.GH_TOKEN }} + ACCESS_TOKEN: ${{secrets.GH_TOKEN}} - name: Create Documentation Artifact uses: actions/upload-artifact@v2 with: name: documentation-api path: talawa-api-docs + + Empty-Commit: + name: Create Empty Commit + runs-on: ubuntu-latest + needs: Generate-Documentation + if: github.ref == 'refs/heads/develop' + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Empty Commit + run: | + git config --global user.name "${{ github.actor }}" + git config --global user.email "${{ github.actor }}@users.noreply.github.com" + git commit --allow-empty -m "Empty commit" + git push origin develop:automated-docs --force - # Copy-docs-to-talawa-docs: - # runs-on: ubuntu-latest - # if: github.ref == 'refs/heads/automated-docs' - # # needs: Generate-Documentation - # steps: - # - uses: actions/checkout@v3 - # - uses: dmnemec/copy_file_to_another_repo_action@v1.1.1 - # env: - # API_TOKEN_GITHUB: ${{secrets.TALAWA_DOCS_SYNC}} - # with: - # source_file: 'talawa-api-docs/' - # destination_repo: 'PalisadoesFoundation/talawa-docs' - # destination_branch: 'develop' - # destination_folder: 'docs/' - # user_email: '${{env.email}}' - # user_name: '${{github.actor}}' - # commit_message: 'Talawa API docs updated' + Copy-docs-to-talawa-docs: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/automated-docs' && contains(github.event.head_commit.message, "Empty commit") + steps: + - uses: actions/checkout@v3 + - uses: dmnemec/copy_file_to_another_repo_action@v1.1.1 + env: + API_TOKEN_GITHUB: ${{secrets.TALAWA_DOCS_SYNC}} + with: + source_file: 'talawa-api-docs/' + destination_repo: 'PalisadoesFoundation/talawa-docs' + destination_branch: 'develop' + destination_folder: 'docs/' + user_email: '${{env.email}}' + user_name: '${{github.actor}}' + commit_message: 'Talawa API docs updated' # You can find the deployment instructions in the scripts/cloud-api-demo/README.md file Deploy-Workflow: