Deploy website #10
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 website | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'website/**' | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| deployments: write | |
| statuses: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout main branch | |
| uses: actions/checkout@v4 | |
| - name: Deploy website directory to website branch | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./website | |
| publish_branch: website | |
| keep_files: true | |
| destination_dir: api | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' | |
| commit_message: ${{ github.event.head_commit.message }} | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| pip install cryptography | |
| - name: Get vercel auth | |
| env: | |
| FERNET_KEY: ${{ secrets.FERNET_KEY }} | |
| run: | | |
| cd tests | |
| python -m util vercel | { | |
| read vercel_token | |
| read org_id | |
| read project_id | |
| } >/dev/null 2>/dev/null | |
| cd .. | |
| - name: Checkout website branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: 'website' | |
| - uses: nexterias/actions-vercel@v1 | |
| id: vercel | |
| with: | |
| token: $vercel_token | |
| org-id: $org_id | |
| project-id: $project_id | |
| production: true | |
| prebuilt: true |