Skip to content

Commit

Permalink
add vercel deploy to deploy.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
ajschmidt8 committed Sep 20, 2024
1 parent e56f790 commit 3929f31
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,23 @@ jobs:
name: Build (and deploy)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/checkout@v4
with:
fetch-depth: 0

# this step uses the `.ruby-version` file
- uses: ruby/setup-ruby@v1

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Build Jekyll Site
run: |
bundle install
bundle exec jekyll build
- uses: aws-actions/configure-aws-credentials@v1-node16
- uses: aws-actions/configure-aws-credentials@4
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
Expand All @@ -48,7 +52,7 @@ jobs:
- name: Post-process docs
run: ci/post-process.sh

- name: Deploy site
- name: Deploy site to Netlify
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_API_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DOCS_SITE_ID }}
Expand All @@ -63,3 +67,19 @@ jobs:
fi
netlify deploy "$ARGS" \
--dir=_site
- name: Deploy site to Vercel
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
run: |
npm install
npm install --global --force vercel
ARGS=""
if [ "$GITHUB_REF_NAME" = "main" ]; then
ARGS="--prod"
fi
./vercel.sh mk-dist
vercel deploy --prebuilt "${ARGS}" --token="${VERCEL_TOKEN}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ lib_map.json
.netlify
__pycache__/
node_modules
.vercel
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ exclude:
- release_checklist.md
- ci/
- node_modules/
- package.json
- package-lock.json
- vercel.sh
- vercel.json
- Gemfile
- Gemfile.lock
include:
- _sources
- _static
Expand Down
10 changes: 9 additions & 1 deletion vercel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ build() {
env | sort

echo "clean output directories..."
rm -rf ./.vercel/output ./_site
rm -rf ./.vercel/ ./_site

echo "building..."
jekyll build
mk-dist
}

mk-dist() {
echo "copying to vercel directory..."
mkdir -p .vercel/output/
node ci/vercel/config.mjs > .vercel/output/config.json
cp -r _site .vercel/output/static
Expand All @@ -42,6 +47,9 @@ case "${CMD}" in
"build")
build
;;
"mk-dist")
mk-dist
;;
*)
echo "${USAGE}"
exit 1
Expand Down

0 comments on commit 3929f31

Please sign in to comment.