Renamed sbcli to sbcli-pre #233
Workflow file for this run
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: Build or Deploy Simplyblock Documentation | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'release/**' | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - edited | |
| - auto_merge_enabled | |
| - auto_merge_disabled | |
| branches: | |
| - 'main' | |
| permissions: | |
| actions: write | |
| contents: write | |
| id-token: write | |
| concurrency: | |
| group: "documentation" | |
| cancel-in-progress: false | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build-test: | |
| if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout Repository" | |
| uses: actions/checkout@v4 | |
| - name: "Prepare Documentation Builder" | |
| run: | | |
| ./doc-builder build-image | |
| - name: "Build Documentation Test" | |
| run: | | |
| ./doc-builder update-repositories | |
| ./doc-builder build | |
| dev-deployment: | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| needs: build-test | |
| steps: | |
| - name: "Checkout Repository" | |
| uses: actions/checkout@v4 | |
| with: | |
| token: '${{ github.token }}' | |
| - name: "Prepare Documentation Builder" | |
| run: | | |
| ./doc-builder build-image | |
| - name: "Prepare Documentation Dev Deployment" | |
| run: | | |
| sed -i -r "s|(site_url: .*)|\1dev/|g" ./mkdocs.yml | |
| cat ./mkdocs.yml | |
| ./doc-builder update-repositories | |
| ./doc-builder build | |
| - name: "Upload Documentation" | |
| uses: SamKirkland/FTP-Deploy-Action@v4.3.5 | |
| with: | |
| server: ${{ secrets.ftp_server }} | |
| username: ${{ secrets.ftp_username }} | |
| password: ${{ secrets.ftp_password }} | |
| server-dir: /dev/ | |
| local-dir: ./site/ | |
| deployment: | |
| if: ${{ startsWith(github.ref, 'refs/heads/release/') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout Repository" | |
| uses: actions/checkout@v4 | |
| with: | |
| token: '${{ github.token }}' | |
| - name: "Prepare Documentation Builder" | |
| run: | | |
| ./doc-builder build-image | |
| - name: "Adjust Release Name: ${{ github.ref_name }}" | |
| env: | |
| name: "${{ github.ref_name }}" | |
| run: | | |
| echo "RELEASE_NAME=$(echo ${name} | sed -e 's/.*\///g')" >> $GITHUB_ENV | |
| - name: "Prepare Documentation Deployment: ${{ env.RELEASE_NAME }}" | |
| run: | | |
| ./doc-builder update-repositories | |
| ./doc-builder deploy ${{ env.RELEASE_NAME }} | |
| - name: "Create Version Tag: ${{ env.RELEASE_NAME }}" | |
| run: | | |
| git config --global --add safe.directory $PWD | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git add deployment | |
| git commit -m "Auto-Build: ${RELEASE_NAME}" | |
| git tag ${RELEASE_NAME} | |
| git push --tags | |
| rm ./deployment/versions.json | |
| rm ./deployment/latest | |
| - name: "Upload Documentation" | |
| uses: SamKirkland/FTP-Deploy-Action@v4.3.5 | |
| with: | |
| server: ${{ secrets.ftp_server }} | |
| username: ${{ secrets.ftp_username }} | |
| password: ${{ secrets.ftp_password }} | |
| server-dir: / | |
| local-dir: ./deployment/ | |
| - name: "Updating Latest" | |
| uses: appleboy/ssh-action@v1.2.1 | |
| with: | |
| host: ${{ secrets.ssh_server }} | |
| port: ${{ secrets.ssh_port }} | |
| username: ${{ secrets.ssh_username }} | |
| key: ${{ secrets.ssh_key }} | |
| script: | | |
| ./update-docs.sh ${{ env.RELEASE_NAME }} | |
| - name: "Merge Tag to Main" | |
| uses: mtanzi/action-automerge@v1 | |
| with: | |
| github_token: "${{ github.token }}" | |
| source: "refs/tags/${{ env.RELEASE_NAME }}" | |
| target: "main" | |
| webhook_url: "" | |
| - name: "Remove Release Branch" | |
| run: | | |
| git push origin :${{ github.ref_name }} |