Skip to content

Commit 2491e0c

Browse files
author
libin
committed
测试调用调用执行
1 parent 97f2d47 commit 2491e0c

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

.github/workflows/deploy.example.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ on:
44
push:
55
branches:
66
- main
7-
- feature/before_after_func
8-
# pull_request:
9-
# branches:
10-
# - main
7+
pull_request:
8+
branches:
9+
- main
1110

1211
env:
1312
DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }}
@@ -65,13 +64,11 @@ jobs:
6564
run: |
6665
export BEFORE_FUNC=$(cat <<'EOF'
6766
echo "I am before function"
68-
sudo touch /data/aaa.txt
6967
EOF
7068
)
7169
7270
export AFTER_FUNC=$(cat <<'EOF'
7371
echo "I am after function"
74-
sudo touch /data/aaa_bbb.txt
7572
EOF
7673
)
7774

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ This project is a neat CD (Continuous Deployment) automated deployment script de
3030
| DOCKER_RUN_PARAMS | No | Additional run parameters passed when starting the container (e.g. `-e ENV=prod`), which can include environment variables, port mappings, etc. |
3131
| SERVER_PASSWORD | No | Server login password (e.g., `mypassword`), only used when `AUTH_METHOD` is `pwd`. |
3232
| SERVER_SSH_PRIVATE_KEY | No | SSH private key content (e.g., `-----BEGIN PRIVATE KEY-----`), used for key login to the server, only used when `AUTH_METHOD` is `key`. |
33+
| BEFORE_FUNC | No | Run script before deployment |
34+
| AFTER_FUNC | No | Run script after deployment |
35+
36+
`BEFORE_FUNC` and `AFTER_FUNC` example code
37+
38+
```bash
39+
BEFORE_FUNC=$(cat <<'EOF'
40+
echo "I am before function"
41+
EOF
42+
)
43+
```
44+
3345

3446
### Running the Script
3547
**Method 1: Run the deployment script directly without downloading**

0 commit comments

Comments
 (0)