Skip to content

Commit

Permalink
Merge pull request #1 from mountainash/feat/debug-vercel-deploy
Browse files Browse the repository at this point in the history
👷‍♂️ Added Debug Action for in project testing
  • Loading branch information
mountainash authored Dec 24, 2023
2 parents b210ad2 + 18e2eb9 commit ddc0c60
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 33 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/debug-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Debug Action CI

on:
workflow_dispatch:
inputs:
ref:
description: 'Ref to run the workflow on'
required: true
default: 'refs/heads/master'

jobs:
debug:
name: Debug Action CI
runs-on: ubuntu-latest

permissions:
contents: read
pull-requests: write
deployments: write

env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

steps:
- name: Checkout ${{ github.event.inputs.ref }} 📥
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

- uses: actions/setup-node@v4
with:
node-version: 20.2
cache: yarn

- name: Install Vercel CLI 📦
run: yarn --cwd website/ add global vercel@latest

- name: Pull Vercel environment information 🔑
run: vercel pull --yes --token=${{ secrets.VERCEL_TOKEN }}

- name: Build website 🏗
env:
LOCAL_REF: ${{ github.event.inputs.ref }}
run: touch index.html && echo "LOCAL_REF=$LOCAL_REF" >> index.html

- name: Deploy to Vercel 🚀
id: verceldeploy
# Fork of https://github.com/BetaHuhn/deploy-to-vercel-action
uses: mountainash/fork-deploy-to-vercel-action@924ce29dfa0ee1980ef938dfee6c853fe7e5732d
with:
# GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

- name: Deploy to Vercel outputs ✍️
run: |
echo "PREVIEW_URL: ${{ needs.verceldeploy.outputs.PREVIEW_URL }}"
echo "DEPLOYMENT_URLS: ${{ needs.verceldeploy.outputs.DEPLOYMENT_URLS }}"
echo "COMMENT_CREATED: ${{ needs.verceldeploy.outputs.COMMENT_CREATED }}"
echo "DEPLOYMENT_INSPECTOR_URL: ${{ needs.verceldeploy.outputs.DEPLOYMENT_INSPECTOR_URL }}"
echo "DEPLOYMENT_UNIQUE_URL: ${{ needs.verceldeploy.outputs.DEPLOYMENT_UNIQUE_URL }}"
34 changes: 1 addition & 33 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,12 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Other Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

Expand All @@ -62,3 +29,4 @@ typings/

# next.js build output
.next
.vercel

0 comments on commit ddc0c60

Please sign in to comment.