From 73c82be2009735102ff8dd86fd9003e8735747af Mon Sep 17 00:00:00 2001 From: Sirawit Chanaburanasak Date: Sun, 15 Sep 2024 12:50:48 +0700 Subject: [PATCH 1/2] feat: deploy preview --- .github/workflows/deploy.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..1f8eca2 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,27 @@ +name: Sync and Deploy to Vercel + +on: + push: + branches: + - dev + +jobs: + sync-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Push to Personal Repo + env: + PERSONAL_REPO: https://x-access-token:${{ secrets.PERSONAL_GITHUB_TOKEN }}@github.com/korawit-alt/sucu-frontend-preview.git + run: | + git remote add personal $PERSONAL_REPO + git push personal HEAD:dev --force + + - name: Deploy to Vercel + uses: amondnet/vercel-action@v20 + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} + working-directory: '.' From 1798599f88489ceb2c5d505db5dbbf3844b8686e Mon Sep 17 00:00:00 2001 From: Sirawit Chanaburanasak Date: Sun, 15 Sep 2024 12:52:35 +0700 Subject: [PATCH 2/2] refactor: fix lint --- .github/workflows/deploy.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1f8eca2..a9e8a26 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,18 +10,18 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout Code - uses: actions/checkout@v3 + - name: Checkout Code + uses: actions/checkout@v3 - - name: Push to Personal Repo - env: - PERSONAL_REPO: https://x-access-token:${{ secrets.PERSONAL_GITHUB_TOKEN }}@github.com/korawit-alt/sucu-frontend-preview.git - run: | - git remote add personal $PERSONAL_REPO - git push personal HEAD:dev --force + - name: Push to Personal Repo + env: + PERSONAL_REPO: https://x-access-token:${{ secrets.PERSONAL_GITHUB_TOKEN }}@github.com/korawit-alt/sucu-frontend-preview.git + run: | + git remote add personal $PERSONAL_REPO + git push personal HEAD:dev --force - - name: Deploy to Vercel - uses: amondnet/vercel-action@v20 - with: - vercel-token: ${{ secrets.VERCEL_TOKEN }} - working-directory: '.' + - name: Deploy to Vercel + uses: amondnet/vercel-action@v20 + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} + working-directory: '.'