Merge pull request #70 from 9oormthon-univ/develop #7
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 Deployment | |
# Deployment - main push 시, | |
on: | |
push: | |
branches: [main] | |
# pull_request: | |
# types: | |
# - closed | |
# branches: [main] | |
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 | |
echo "VITE_APP_GPT_URL=$VITE_APP_GPT_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}} | |
VITE_APP_GPT_URL: ${{secrets.VITE_APP_GPT_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-deploy | |
message: | | |
### 🚀 Deploy Success! - [https://sodong.pages.dev/](https://sodong.pages.dev/) | |
| 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 }} | | |
--- |