You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
184 lines
6.1 KiB
YAML
184 lines
6.1 KiB
YAML
name: 🚀 Deploy INFO-SYS
|
|
|
|
on:
|
|
# Triggers the workflow on push or pull request events but only for the master branch
|
|
push:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
gh-win-cn-deploy:
|
|
name: 🎉 Deploy InfoSys to CN
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 🚚 Get latest code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: 📂 Sync files to CHT
|
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
|
with:
|
|
server: ${{ secrets.CN_FTP_SERVER }}
|
|
username: ${{ secrets.CN_FTP_USER }}
|
|
password: ${{ secrets.CN_FTP_PASSWORD }}
|
|
port: ${{ secrets.CN_FTP_PORT }}
|
|
local-dir: ./
|
|
server-dir: /wwwroot/origin-cht.mycht.cn/
|
|
# dry-run: true
|
|
# log-level: verbose
|
|
exclude: |
|
|
**/.git*
|
|
**/.git*/**
|
|
**/node_modules/**
|
|
document/**
|
|
download_statement/**
|
|
sample/**
|
|
**/logs/**
|
|
**/web.config
|
|
**/author/document/**
|
|
*.exe
|
|
*.docx
|
|
.ftp-deploy-sync-state.json
|
|
|
|
gh-win-us-deploy:
|
|
needs: gh-win-cn-deploy
|
|
name: 🎉 Deploy InfoSys to US
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 🚚 Get latest code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: 📂 Sync files to CHT
|
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
|
with:
|
|
server: ${{ secrets.US_FTP_SERVER }}
|
|
username: ${{ secrets.US_FTP_USER }}
|
|
password: ${{ secrets.US_FTP_PASSWORD }}
|
|
port: ${{ secrets.US_FTP_PORT }}
|
|
local-dir: ./
|
|
server-dir: /information-system/
|
|
# dry-run: true
|
|
exclude: |
|
|
**/.git*
|
|
**/.git*/**
|
|
**/node_modules/**
|
|
document/**
|
|
download_statement/**
|
|
sample/**
|
|
**/logs/**
|
|
**/web.config
|
|
**/author/document/**
|
|
*.exe
|
|
*.docx
|
|
.ftp-deploy-sync-state.json
|
|
- name: 📂 Sync files to CT
|
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
|
with:
|
|
server: ${{ secrets.US_FTP_SERVER }}
|
|
username: ${{ secrets.US_FTP_USER }}
|
|
password: ${{ secrets.US_FTP_PASSWORD }}
|
|
port: ${{ secrets.US_FTP_PORT }}
|
|
local-dir: ./
|
|
server-dir: /origin-ct.mycht.cn/
|
|
# dry-run: true
|
|
exclude: |
|
|
**/.git*
|
|
**/.git*/**
|
|
**/node_modules/**
|
|
document/**
|
|
download_statement/**
|
|
sample/**
|
|
**/logs/**
|
|
**/web.config
|
|
**/author/document/**
|
|
*.exe
|
|
*.docx
|
|
.ftp-deploy-sync-state.json
|
|
|
|
|
|
|
|
hn-notification:
|
|
needs: gh-win-cn-deploy
|
|
name: 🔔 Send notificaiton
|
|
runs-on: ubuntu-latest
|
|
if: always() # set "always"
|
|
steps:
|
|
- name: 🚚 Get latest code
|
|
uses: actions/checkout@v3
|
|
# run this action to get the workflow conclusion
|
|
# You can get the conclusion via env (env.WORKFLOW_CONCLUSION)
|
|
- uses: technote-space/workflow-conclusion-action@v3
|
|
|
|
- name: Expose git commit data
|
|
uses: rlespinasse/git-commit-data-action@v1
|
|
|
|
- name: Print git commit data
|
|
run: |
|
|
echo "Get workflow conclusion"
|
|
echo " - ${{ env.WORKFLOW_CONCLUSION }}"
|
|
echo "Get commit info"
|
|
echo " - ${{ env.GIT_COMMIT_SHA }}"
|
|
echo " - ${{ env.GIT_COMMIT_SHORT_SHA }}"
|
|
|
|
# echo "Get author info"
|
|
# echo " - ${{ env.GIT_COMMIT_AUTHOR }}"
|
|
# echo " - ${{ env.GIT_COMMIT_AUTHOR_NAME }}"
|
|
# echo " - ${{ env.GIT_COMMIT_AUTHOR_EMAIL }}"
|
|
# echo "Get committer info"
|
|
# echo " - ${{ env.GIT_COMMIT_COMMITTER }}"
|
|
# echo " - ${{ env.GIT_COMMIT_COMMITTER_NAME }}"
|
|
# echo " - ${{ env.GIT_COMMIT_COMMITTER_EMAIL }}"
|
|
# echo "Get message info"
|
|
# echo " - ${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}"
|
|
# echo " - ${{ env.GIT_COMMIT_MESSAGE_SUBJECT_SANITIZED }}"
|
|
# echo " - ${{ env.GIT_COMMIT_MESSAGE_BODY }}"
|
|
|
|
- name: ✉ Send some mail
|
|
uses: dawidd6/action-send-mail@v3
|
|
with:
|
|
# Specify connection via URL (replaces server_address, server_port, secure,
|
|
# username and password)
|
|
#
|
|
# Format:
|
|
#
|
|
# * smtp://user:password@server:port
|
|
# * smtp+starttls://user:password@server:port
|
|
# connection_url: ${{secrets.MAIL_CONNECTION}}
|
|
# Required mail server address if not connection_url:
|
|
server_address: hwsmtp.exmail.qq.com
|
|
# Server port, default 25:
|
|
server_port: 465
|
|
# Optional whether this connection use TLS (default is true if server_port is 465)
|
|
secure: true
|
|
# Optional (recommended) mail server username:
|
|
username: ${{secrets.MAIL_USERNAME}}
|
|
# Optional (recommended) mail server password:
|
|
password: ${{secrets.MAIL_PASSWORD}}
|
|
# Required mail subject:
|
|
subject: ${{env.WORKFLOW_CONCLUSION}} ${{ github.repository }}
|
|
# Required recipients' addresses:
|
|
to: ${{ env.GIT_COMMIT_COMMITTER_EMAIL }}
|
|
# Required sender full name (address can be skipped):
|
|
from: Git # <user@example.com>
|
|
# Optional plain body:
|
|
body: |
|
|
${{ env.WORKFLOW_CONCLUSION }}
|
|
${{ github.repository }}
|
|
${{ env.GIT_COMMIT_SHORT_SHA }}: ${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}
|
|
# Optional HTML body read from file:
|
|
# html_body: file://README.html
|
|
# Optional carbon copy recipients:
|
|
# cc: lyt@hainatravel.com
|
|
# Optional blind carbon copy recipients:
|
|
# bcc: r2d2@example.com,hansolo@example.com
|
|
# Optional recipient of the email response:
|
|
# reply_to: luke@example.com
|
|
# Optional Message ID this message is replying to:
|
|
# in_reply_to: <random-luke@example.com>
|
|
# Optional unsigned/invalid certificates allowance:
|
|
ignore_cert: true
|
|
# Optional converting Markdown to HTML (set content_type to text/html too):
|
|
convert_markdown: true
|
|
# Optional attachments:
|
|
# attachments: attachments.zip,git.diff,./dist/static/*.js
|
|
# Optional priority: 'high', 'normal' (default) or 'low'
|
|
priority: low
|