From a09a5114aa73c938d2a724c6b0a42c97e555c8da Mon Sep 17 00:00:00 2001 From: MoonbamiOfficial <141120384+MoonbamiOfficial@users.noreply.github.com> Date: Sun, 4 Aug 2024 19:35:07 +0800 Subject: [PATCH] feat: add deployment github actions --- .github/workflows/preview.yaml | 28 ++++++++++++++++++++++++++++ .github/workflows/production.yaml | 28 ++++++++++++++++++++++++++++ .gitignore | 5 ++++- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/preview.yaml create mode 100644 .github/workflows/production.yaml diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml new file mode 100644 index 0000000..0100d83 --- /dev/null +++ b/.github/workflows/preview.yaml @@ -0,0 +1,28 @@ +name: Sassy CSS Preview Deployment + +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + +on: + push: + branches-ignore: + - main + +jobs: + Preview-Deployment: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Vercel CLI + run: pnpm i -g vercel + + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment-preview --token=${{ secrets.VERCEL_SASSY_TOKEN }} + + - name: Build Project for Preview + run: vercel build --token=${{ secrets.VERCEL_SASSY_TOKEN }} + + - name: Deploy + run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_SASSY_TOKEN }} diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml new file mode 100644 index 0000000..e74da85 --- /dev/null +++ b/.github/workflows/production.yaml @@ -0,0 +1,28 @@ +name: Sassy CSS Production Deployment + +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + +on: + push: + branches: + - main + +jobs: + Production-Deployment: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Vercel CLI + run: pnpm i -g vercel + + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment-production --token=${{ secrets.VERCEL_SASSY_TOKEN }} + + - name: Build Project for Production + run: vercel build --prod --token=${{ secrets.VERCEL_SASSY_TOKEN }} + + - name: Deploy + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_SASSY_TOKEN }} diff --git a/.gitignore b/.gitignore index 2812b1c..04b155c 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,7 @@ dist-ssr .env # misc -icons-credits.txt \ No newline at end of file +icons-credits.txt + +# Vercel specifics +.vercel