-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (66 loc) · 2.15 KB
/
deploy-development.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Development Web Deploy
on:
push:
branches:
- main
pull_request:
paths-ignore:
- '**.md'
- '.github/**/!(*.yml)'
- '.husky/**/*'
- '.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:
- name: Checkout Branch
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Download Built App
uses: actions/download-artifact@v3
with:
name: built-web
path: apps/web/out
- name: Publish
id: publish
run: |
set -o pipefail
yarn dlx wrangler@3 pages deploy "out" --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
working-directory: apps/web
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