This repository has been archived by the owner on Sep 1, 2024. It is now read-only.
fix preview deploy #20
Workflow file for this run
This file contains 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: GitHub Pages | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
on: | |
push: | |
branches-ignore: | |
- master | |
pull_request: | |
jobs: | |
deploy-preview: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 'latest' | |
extended: true | |
- name: Install Vercel CLI | |
run: npm install --global vercel@latest | |
- name: SetUp Env | |
run: hugo new site testenv | |
- name: Set theme | |
uses: actions/checkout@v3 | |
with: | |
path: ./testenv/themes/hugo-theme-shell | |
- name: Build | |
run: hugo --minify -t hugo-theme-shell | |
working-directory: ./testenv | |
- name: Pull Vercel Environment Information | |
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} --cwd ./testenv | |
- name: Build Project Artifacts | |
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} --cwd ./testenv | |
- name: Deploy Project Artifacts to Vercel | |
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --cwd ./testenv | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./testenv/public |