vercel로 github organization에 있는 팀 프로젝트를 배포하려고 했는데, free trial 횟수를 넘겨서 무료로 배포를 할 수 없었다. 🥲
이를 해결할 수 있는 방법을 찾아보다가 팀 프로젝트를 개인 프로젝트로 fork해와 무료로 배포할 수 있는 방법을 찾게 되었다.
bulid.sh
파일을 생성한다.#!/bin/sh
cd ../
mkdir output
cp -R ./팀 레포지토리 이름/* ./output
cp -R ./output ./팀 레포지토리 이름/
개인 계정 이메일
과 개인 계정에서 발급한 토큰
을 시크릿 변수에 등록한다.name: git push into another repo to deploy to vercel
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
container: pandoc/latex
steps:
- uses: actions/checkout@v2
- name: Install mustache (to update the date)
run: apk add ruby && gem install mustache
- name: creates output
run: sh ./build.sh
- name: Pushes to another repository
id: push_directory
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.AUTH_TOKEN }} // 변경
with:
source-directory: 'output'
destination-github-username: 개인 깃헙 아이디 // 변경
destination-repository-name: fork 해 온 개인 레포 이름 // 변경
user-email: ${{ secrets.OFFICIAL_ACCOUNT_EMAIL }} // 변경
commit-message: ${{ github.event.commits[0].message }}
target-branch: main
- name: Test get variable exported by push-to-another-repository
run: echo $DESTINATION_CLONED_DIRECTORY
참고 자료
GitHub Organization 프로젝트를 vercel 무료로 연동하기 (+git actions)
vercel로 배포한 앱에 .env(환경 변수) 적용하기