Update workflow to run on all branches #8
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 to Vercel | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| pull_request: | |
| branches: | |
| - "**" | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 2 | |
| - name: Debug Info | |
| env: | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| run: | | |
| echo "Checking secrets..." | |
| if [ -n "$VERCEL_TOKEN" ]; then | |
| echo "VERCEL_TOKEN is set" | |
| else | |
| echo "VERCEL_TOKEN is NOT set" | |
| fi | |
| if [ -n "$VERCEL_ORG_ID" ]; then | |
| echo "VERCEL_ORG_ID is set" | |
| else | |
| echo "VERCEL_ORG_ID is NOT set" | |
| fi | |
| if [ -n "$VERCEL_PROJECT_ID" ]; then | |
| echo "VERCEL_PROJECT_ID is set" | |
| else | |
| echo "VERCEL_PROJECT_ID is NOT set" | |
| fi | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v2 | |
| with: | |
| hugo-version: "0.135.0" | |
| extended: true | |
| - name: Install Dependencies | |
| run: npm install | |
| - name: Build | |
| run: hugo --minify | |
| - name: Deploy to Vercel | |
| uses: amondnet/vercel-action@v25 | |
| with: | |
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
| vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | |
| working-directory: ./ | |
| vercel-args: "--prod" |