修改文章内容:使用 vscode 简单配置 ESP32 连接 Wi-Fi 每日定时发送 HTTP 和 HTTPS 请求 #567
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
# .github/workflows/nodejs.yml | |
on: # 触发此文件运行的条件 | |
workflow_dispatch: # 手动 | |
push: # push 时 | |
name: CI/CD # 此工作流程(workflow)的名字 | |
jobs: | |
FTP-Deploy-Action: | |
name: CI&CD # 此任务(job)的名字 | |
runs-on: ubuntu-24.04 # 运行环境 | |
steps: | |
- uses: actions/checkout@v4 # 切换分支 | |
with: | |
fetch-depth: 2 | |
- name: Use Node.js 16 | |
uses: actions/setup-node@v4 # 使用node环境 | |
with: | |
node-version: 16 # 版本16 | |
- name: Cache node modules | |
id: cache # 缓存id | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules # 缓存名字 | |
with: | |
path: node_modules # 缓存路径 | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }} # 缓存标识 | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' # 如果没有缓存的话 | |
run: npm install # 安装依赖 | |
- name: Build project | |
run: npm run docs:build # 构建项目和生成代码覆盖率报告 | |
env: | |
LEANCLOUD_APP_ID: ${{ secrets.LEANCLOUD_APP_ID }} # 评 论系统的ID | |
LEANCLOUD_APP_KEY: ${{ secrets.LEANCLOUD_APP_KEY }} # 评论系统的KEY | |
# 如果FTP-Deploy-Action出现,Dirty repository: Having uncommitted changes. 问题时,使用以下注释步骤解决问题 | |
- name: reset git | |
run: git reset --hard | |
- name: 📂 Sync files | |
uses: SamKirkland/FTP-Deploy-Action@v4.3.5 | |
with: | |
server: ${{ secrets.FTP_IP }} | |
username: ${{ secrets.FTP_USERNAME }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
local-dir: docs/.vuepress/dist/ # 选择哪些文件要部署到服务器,这个选项在这里选了之后,要在.git-ftp-include中添加相应的路径 | |
server-dir: / | |
# ftp-server: sftp://${{ secrets.FTP_IP }}/home/www/htdocs # 服务器地址和端口(可以填域名,不过我服务器做了全站加速会导向加速结点的IP,所以只能用服务器的IP) | |
# ftp-username: ${{ secrets.FTP_USERNAME }} # FTP用户名 | |
# ftp-password: ${{ secrets.FTP_PASSWORD }} # FTP密码 | |
# git-ftp-args: --insecure # (如果是FTP连接的话--insecure不用加) | |
# local-dir: docs/.vuepress/dist/ # 选择哪些文件要部署到服务器,这个选项在这里选了之后,要在.git-ftp-include中添加相应的路径 | |
- name: upload-artifact | |
uses: actions/upload-artifact@v4 #共享或保存action过程中产生的文件 | |
with: | |
name: static_web_file | |
path: ./docs/.vuepress/dist/ # or path/to/artifact |