From 4d792c8176211e3f778d1eb95f2ed16e43558905 Mon Sep 17 00:00:00 2001 From: Tekiter Date: Sun, 23 Jul 2023 01:03:53 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=B0=B0=ED=8F=AC=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EB=B3=80=EA=B2=BD=20(#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-web.yml | 45 -------------------- .github/workflows/deploy-development.yml | 54 ++++++------------------ 2 files changed, 14 insertions(+), 85 deletions(-) delete mode 100644 .github/workflows/build-web.yml diff --git a/.github/workflows/build-web.yml b/.github/workflows/build-web.yml deleted file mode 100644 index f561b89..0000000 --- a/.github/workflows/build-web.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Build Web - -on: - workflow_call: - secrets: - env: - required: true - inputs: - upload: - required: false - type: boolean - default: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'yarn' - - - name: Install Packages - run: yarn install --immutable - env: - CI: true - - - name: Set .env - run: echo "${{ secrets.env }}" > apps/web/.env.local - - - run: echo apps/web/.env.local - - - name: Build - run: yarn build:pages - working-directory: apps/web - - - uses: actions/upload-artifact@v3 - with: - name: built-web - path: apps/web/.vercel/output/static - if-no-files-found: error - retention-days: 7 diff --git a/.github/workflows/deploy-development.yml b/.github/workflows/deploy-development.yml index 37cee1f..088d274 100644 --- a/.github/workflows/deploy-development.yml +++ b/.github/workflows/deploy-development.yml @@ -12,13 +12,7 @@ on: - '.vscode/**/*' jobs: - build-web: - uses: ./.github/workflows/build-web.yml - secrets: - env: ${{ secrets.DEVELOPMENT_WEB_ENV }} - deploy-web: - needs: build-web runs-on: ubuntu-latest name: Deploy Web to Cloudflare Pages steps: @@ -27,17 +21,25 @@ jobs: with: fetch-depth: 2 - - name: Download Built App - uses: actions/download-artifact@v3 + - uses: actions/setup-node@v3 with: - name: built-web - path: apps/web/out + node-version: 18 + cache: 'yarn' + + - name: Install Packages + run: yarn install --immutable + env: + CI: true + + - name: Build Web + run: yarn build:pages + working-directory: apps/web - name: Publish Web id: publish run: | set -o pipefail - yarn dlx wrangler@3 pages deploy "out" --project-name "${{ vars.PAGES_NAME_WEB_DEVELOPMENT }}" | tee deploy.log + yarn wrangler pages deploy ".vercel/output/static" --project-name "${{ vars.PAGES_NAME_WEB_DEVELOPMENT }}" | tee deploy.log echo "log<> $GITHUB_OUTPUT echo "$(cat deploy.log)" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT @@ -49,36 +51,8 @@ jobs: - name: Publish SSR Gateway if: github.event_name == 'push' run: | - yarn dlx wrangler@3 deploy -e preview + yarn wrangler deploy -e preview working-directory: apps/ssr-gateway env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - - - name: Get Preview URL - uses: actions-ecosystem/action-regex-match@v2 - id: regex-match - with: - text: ${{ steps.publish.outputs.log }} - regex: '(https:\/\/[A-z0-9]+\.[^\.]+\.pages\.dev)' - - - name: Find Comment - if: github.event_name == 'pull_request' - uses: peter-evans/find-comment@v2 - id: find_comment - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: 프리뷰 배포 확인하기 - - - name: Create or update comment - if: github.event_name == 'pull_request' - uses: peter-evans/create-or-update-comment@v2 - with: - comment-id: ${{ steps.find_comment.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - 🚀 프리뷰 배포 확인하기 🚀 - - ${{ steps.regex-match.outputs.group1 }} - edit-mode: replace