Merge pull request #373 from EvanNotFound/dev #7
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: Vercel Production Deployment | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
Deploy-Production: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout theme repository | |
uses: actions/checkout@v3 | |
with: | |
path: 'theme' # Checkout the theme repository into a directory named 'theme' | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.x' # Specify your required Node.js version | |
- name: Clone Hexo site repository | |
run: git clone https://github.com/EvanNotFound/redefine-demo.git hexo-site | |
- name: Move theme into Hexo site | |
run: | | |
mv theme hexo-site/themes/redefine | |
- name: Install dependencies | |
run: | | |
cd hexo-site | |
npm install | |
- name: Build Hexo | |
run: | | |
cd hexo-site | |
npm install | |
npm uninstall hexo-theme-redefine | |
npm run build | |
# - name: Install Vercel CLI | |
# run: npm install --global vercel@canary | |
- name: Change directory to hexo-site | |
run: echo "HEXO_SITE_DIR=${{ github.workspace }}/hexo-site" >> $GITHUB_ENV | |
# - uses: amondnet/vercel-action@v20 #deploy | |
# with: | |
# vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required | |
# vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required | |
# github-token: ${{ secrets.GITHUB_TOKEN }} #Optional | |
# vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required | |
# working-directory: ${{ env.HEXO_SITE_DIR }} | |
- name: Deploy to Vercel Action | |
uses: EvanNotFound/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
WORKING_DIRECTORY: ${{ env.HEXO_SITE_DIR }} | |
VERCEL_SCOPE: ${{ secrets.VERCEL_SCOPE }} | |
PRODUCTION: true | |
DEPLOY_PR_FROM_FORK: true | |
PR_PREVIEW_DOMAIN: "redefine-preview-pr-{PR}.vercel.app" | |
# - name: Pull Vercel Environment Information | |
# run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
# working-directory: ${{ env.HEXO_SITE_DIR }} | |
# - name: Build Project Artifacts | |
# run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
# working-directory: ${{ env.HEXO_SITE_DIR }} | |
# - name: Deploy Project Artifacts to Vercel | |
# run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | |
# working-directory: ${{ env.HEXO_SITE_DIR }} |