Skip to content

Commit

Permalink
chore: 배포 스크립트 변경 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tekiter authored Jul 22, 2023
1 parent 38e360a commit 4d792c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 85 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/build-web.yml

This file was deleted.

54 changes: 14 additions & 40 deletions .github/workflows/deploy-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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<<EOF" >> $GITHUB_OUTPUT
echo "$(cat deploy.log)" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
Expand All @@ -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

0 comments on commit 4d792c8

Please sign in to comment.