Skip to content

Commit dad3f13

Browse files
committed
refactor(workflow): standardize script execution and modularize deployment
• Replaced direct script executions with sh for consistency across different environments. • Introduced deploy.sh to encapsulate deployment logic, improving maintainability and reusability. • Removed inline deployment commands from the workflow to streamline and declutter the YAML file. • Enhanced readability and consistency across all script invocations in the workflow.
1 parent 3dfe8f2 commit dad3f13

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

.github/workflows/pull_request.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# Do nothing
2222
exit 0
2323
post: |
24-
./post_check.sh
24+
sh post_check.sh
2525
- name: Setup SSH key
2626
uses: ./
2727
with:
@@ -31,7 +31,7 @@ jobs:
3131
- name: Check known hosts
3232
shell: bash
3333
run: |
34-
./check.sh
34+
sh check.sh
3535
- name: Install docker (Missing on MacOS)
3636
if: runner.os == 'macos'
3737
shell: bash
@@ -42,8 +42,4 @@ jobs:
4242
env:
4343
DOCKER_HOST: ${{ secrets.DOCKER_HOST }}
4444
run: |
45-
# renovate: datasource=docker depname=traefik/whoami versioning=docker
46-
WHOAMI_VERSION="43a68d10b9dfcfc3ffbfe4dd42100dc9aeaf29b3a5636c856337a5940f1b4f1c" # v1.10
47-
docker run --detach --publish-all --name whoami traefik/whoami:"${WHOAMI_VERSION}"
48-
docker stop whoami
49-
docker rm whoami
45+
sh deploy.sh

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ runs:
5151
SSH_KNOWN_HOSTS_FILE: '~/.ssh/known_hosts'
5252
with:
5353
main: |
54-
./action.sh
54+
sh action.sh
5555
post: |
56-
./post_action.sh
56+
sh post_action.sh
5757

deploy.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
# renovate: datasource=docker depname=traefik/whoami versioning=docker
4+
WHOAMI_VERSION="43a68d10b9dfcfc3ffbfe4dd42100dc9aeaf29b3a5636c856337a5940f1b4f1c" # v1.10
5+
docker run --detach --publish-all --name whoami traefik/whoami:"${WHOAMI_VERSION}"
6+
docker stop whoami
7+
docker rm whoami

0 commit comments

Comments
 (0)