Deploy Branch unity/v4.0 - Unity - 4.0 by @cdhanna #13
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 Docs Branch | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Enter branch to deploy (must exist in the repo)' | |
| required: true | |
| type: string | |
| sdk: | |
| description: 'Select SDK to deploy' | |
| required: true | |
| type: choice | |
| options: | |
| - Unity | |
| - Unreal | |
| - WebSDK | |
| version: | |
| description: 'Version to deploy (e.g., 4.0, 2.2, 0.6)' | |
| required: true | |
| type: string | |
| run-name: Deploy Branch ${{ github.event.inputs.branch }} - ${{ github.event.inputs.sdk }} - ${{ github.event.inputs.version }} by @${{ github.actor }} | |
| jobs: | |
| deploy: | |
| name: Deploy ${{ github.event.inputs.branch }} - ${{ github.event.inputs.sdk }} - ${{ github.event.inputs.version }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout main branch first | |
| - name: Checkout main | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| # Run setup.sh | |
| - name: Run setup.sh | |
| run: bash setup.sh | |
| # Fetch all remote branches | |
| - name: Fetch remote branch names | |
| run: git fetch --depth=1 origin +refs/heads/*:refs/remotes/origin/* | |
| # Verify the branch exists | |
| - name: Verify branch exists | |
| run: | | |
| if ! git show-ref --verify --quiet refs/remotes/origin/${{ github.event.inputs.branch }}; then | |
| echo "Error: Branch '${{ github.event.inputs.branch }}' does not exist." | |
| exit 1 | |
| fi | |
| # Checkout the gh-pages branch | |
| - name: Checkout gh-pages branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: gh-pages | |
| # Checkout the selected branch | |
| - name: Checkout selected branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.branch }} | |
| - name: Configure git for mike | |
| run: | | |
| git config --global user.name "${{ github.actor }}" | |
| git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
| # Deploy with mike | |
| - name: Deploy SDK with mike | |
| run: mike deploy "${{ github.event.inputs.sdk }}-${{ github.event.inputs.version }}" --push | |