Deploy-Sub #5
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: Deploy-Sub | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| domain: | |
| description: 'The sub domain' | |
| required: true | |
| type: choice | |
| options: | |
| - pre.goravel.dev | |
| - v116.goravel.dev | |
| branch: | |
| description: 'The sub branch' | |
| required: true | |
| type: string | |
| concurrency: | |
| group: deploy-${{ inputs.domain }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.branch }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: pnpm | |
| - name: Build with VitePress | |
| run: pnpm docs:build | |
| - name: Push build | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: .vitepress/dist | |
| publish_branch: gh-pages-${{ inputs.domain }} | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy-Pre | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.SERVER_HOST }} | |
| username: ${{ secrets.SERVER_USERNAME }} | |
| password: ${{ secrets.SERVER_PASSWORD }} | |
| port: ${{ secrets.SERVER_PORT }} | |
| allenvs: true | |
| script: | | |
| cd /data/wwwroot/${{ inputs.domain }}/ && git pull origin gh-pages-${{ inputs.domain }} |