Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add develop version github workflow #47

Merged
merged 1 commit into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/dev-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Dev Version Deploy

on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- "develop"

workflow_dispatch:
inputs:
projectName:
description: "Cloudflare page name"
required: false

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"

- name: Install # optional, --immutable
run: |
yarn install --frozen-lockfile

- name: Build
run: |
export NODE_OPTIONS="--max_old_space_size=4096"
yarn build

- id: deploy
name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy ./build --project-name=${{ inputs.projectName || vars.CF_PROJECT_NAME }}

- name: Notify deploy success
if: ${{ success() }}
uses: joelwmale/[email protected]
with:
url: ${{ secrets.WEBHOOK_URL }}
body: |
{
"msg_type": "post",
"content": {
"post": {
"en": {
"title": "${{ github.repository }} Pull request deployed",
"content": [
[
{
"tag": "text",
"text": "🚢 Branch ${{ github.head_ref || github.ref_name }} has been deployed. The preview URL is "
},
{
"tag": "a",
"text": "${{ steps.deploy.outputs.deployment-url }}",
"href": "${{ steps.deploy.outputs.deployment-url }}"
}
]
]
}
}
}
}

- name: Notify deploy failure
if: ${{ failure() }}
uses: joelwmale/[email protected]
with:
url: ${{ secrets.WEBHOOK_URL }}
body: |
{
"msg_type": "post",
"content": {
"post": {
"en": {
"title": "${{ github.repository }} Pull request deployment failed",
"content": [
[
{
"tag": "text",
"text": "🚧 Branch ${{ github.head_ref || github.ref_name }} deployment failed!. Check the "
},
{
"tag": "a",
"text": "Action ${{ github.run_id }}",
"href": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
},
{
"tag": "text",
"text": " for detail."
}
]
]
}
}
}
}
33 changes: 32 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,35 @@ website/i18n/**/*
#!website/i18n/fr
#!website/i18n/fr/**/*

.netlify
.netlify

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
build
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.wrangler
.env
.dev.vars
.yarn/*
Loading
Loading