[ํฌ์คํธ ๊ณต์ ] ํฌ์คํธ ์๋ฃ UI ๋ณ๊ฒฝ ๋ฐ์ #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cloudflare Pages Preview | |
# Preview - main, develop PR open ์ | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
branches: [main, develop] | |
env: | |
CI: false | |
permissions: | |
contents: read | |
deployments: write | |
pull-requests: write | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
name: Publish to Cloudflare Pages | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Generate Env File | |
run: | | |
echo "VITE_KAKAO_REST_API=$VITE_KAKAO_REST_API" >> .env | |
echo "VITE_APP_BASE_URL=$VITE_APP_BASE_URL" >> .env | |
echo "VITE_APP_FAST_URL=$VITE_APP_FAST_URL" >> .env | |
env: | |
VITE_KAKAO_REST_API: ${{secrets.VITE_KAKAO_REST_API}} | |
VITE_APP_BASE_URL: ${{secrets.VITE_APP_BASE_URL}} | |
VITE_APP_FAST_URL: ${{secrets.VITE_APP_FAST_URL}} | |
- name: Build | |
run: yarn install && yarn build | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
id: cloudflare | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: sodong | |
directory: dist | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Comment PR | |
uses: mshick/add-pr-comment@v2 | |
with: | |
message-id: cloudflare-preview | |
message: | | |
### ๐ Preview Success! | |
| Name | Link | | |
|---------------------------------|------------------------| | |
|<span aria-hidden="true">๐จ</span> Latest commit | ${{ github.sha }} | | |
|<span aria-hidden="true">๐</span> Latest deploy log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | | |
|<span aria-hidden="true">๐๏ธ</span> Deploy Preview Url | [${{ steps.cloudflare.outputs.url }}](${{ steps.cloudflare.outputs.url }}) | | |
|<span aria-hidden="true">๐ณ</span> Environment | ${{ steps.cloudflare.outputs.environment }} | | |
--- |