delete #598
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: Main Deletion Job | |
| on: | |
| repository_dispatch: | |
| types: [ 'delete' ] | |
| jobs: | |
| delete: | |
| runs-on: ubuntu-latest | |
| name: "Delete ${{ github.event.client_payload.vendor }}/${{ github.event.client_payload.name }}:${{ github.event.client_payload.target_branch_directory }}" | |
| if: ${{ github.event.client_payload.type_short != '' && github.event.client_payload.name != '' && github.event.client_payload.vendor != '' && github.event.client_payload.target_branch_directory != '' }} | |
| steps: | |
| - name: "Deleting ${{ github.event.client_payload.vendor }}/${{ github.event.client_payload.name }}:${{ github.event.client_payload.target_branch_directory }}" | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.DEPLOY_DOCS_HOST }} | |
| username: ${{ secrets.DEPLOY_DOCS_USERNAME }} | |
| key: ${{ secrets.DEPLOY_KEY }} | |
| script: rm -Rf ${{ secrets.TARGET_PATH }}/${{ github.event.client_payload.type_short }}/${{ github.event.client_payload.vendor }}/${{ github.event.client_payload.name }}/${{ github.event.client_payload.target_branch_directory }} | |
| - name: Deleting search data | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.DEPLOY_DOCS_HOST }} | |
| username: ${{ secrets.DEPLOY_DOCS_USERNAME }} | |
| key: ${{ secrets.DEPLOY_KEY }} | |
| command_timeout: 1m | |
| script: | | |
| export APP_ENV=prod | |
| export APP_SECRET=${{ secrets.DOC_SEARCH_APP_SECRET }} | |
| export DOCS_ROOT_PATH=${{ secrets.TARGET_PATH }} | |
| cd ${{ secrets.DOC_SEARCH_PATH }} | |
| ./bin/console docsearch:index:delete --manual-type=${{ github.event.client_payload.type_short }} --manual-package=${{ github.event.client_payload.vendor }}/${{ github.event.client_payload.name }} --manual-version=${{ github.event.client_payload.target_branch_directory }} | |
| - name: Notify on failure | |
| if: ${{ failure() }} | |
| uses: distributhor/workflow-webhook@v1 | |
| env: | |
| webhook_url: ${{ secrets.WEBHOOK_DELETION_URL }} | |
| webhook_secret: ${{ secrets.WEBHOOK_SECRET }} | |
| data: '{"success":false,"id":"${{ github.event.client_payload.id }}","link":"https://github.com/TYPO3-Documentation/t3docs-ci-deploy/actions/runs/${{ github.run_id }}"}' | |
| - name: Notify on success | |
| if: ${{ success() }} | |
| uses: distributhor/workflow-webhook@v1 | |
| env: | |
| webhook_url: ${{ secrets.WEBHOOK_DELETION_URL }} | |
| webhook_secret: ${{ secrets.WEBHOOK_SECRET }} | |
| data: '{"success":true,"id":"${{ github.event.client_payload.id }}","link":"https://github.com/TYPO3-Documentation/t3docs-ci-deploy/actions/runs/${{ github.run_id }}"}' |