Deploy website #3
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 the scratchattach website | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'website/**' | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Deploy website directory to website branch | |
| run: | | |
| git worktree add /tmp/website --orphan website | |
| cd /tmp/website | |
| rm -rf * | |
| cp -r ${{ github.workspace }}/website/* . | |
| git add . | |
| git commit -m "Deploy website directory to website branch" | |
| git push -u origin website --force |