66
66
echo "Hashes do not match. Continuing workflow."
67
67
fi
68
68
69
- build :
69
+ build-and-deploy :
70
70
name : Build artifact
71
71
runs-on : ubuntu-latest
72
72
needs : check
@@ -102,31 +102,6 @@ jobs:
102
102
run : |
103
103
sh ./ci-release-build.sh
104
104
105
- - uses : actions/upload-artifact@v4
106
- with :
107
- name : dist
108
- path : assets/release.zip
109
- retention-days : 7
110
-
111
- - name : Store artifact commit version
112
- shell : bash
113
- id : store
114
- run : |
115
- sha_short=$(git rev-parse --short HEAD)
116
- branch_name=$(git rev-parse --abbrev-ref HEAD)
117
- echo "sha_short=$sha_short" >> "$GITHUB_OUTPUT"
118
- echo "branch=$branch_name" >> "$GITHUB_OUTPUT"
119
-
120
- deploy :
121
- name : Deploy artifact
122
- runs-on : ubuntu-latest
123
- needs : build
124
- steps :
125
- - name : Download artifact
126
- uses : actions/download-artifact@v4
127
- with :
128
- name : dist
129
-
130
105
- name : copy file via ssh password
131
106
uses : appleboy/scp-action@v0.1.7
132
107
with :
@@ -135,7 +110,7 @@ jobs:
135
110
password : ${{ secrets.PASSWORD }}
136
111
key : ${{ secrets.KEY }}
137
112
port : ${{ secrets.PORT }}
138
- source : ' release.zip'
113
+ source : ' assets/ release.zip'
139
114
target : ' /tmp/shiro'
140
115
141
116
- name : Exec deploy script with SSH
@@ -168,10 +143,19 @@ jobs:
168
143
pm2 save
169
144
echo "Deployed successfully"
170
145
146
+ - name : Store artifact commit version
147
+ shell : bash
148
+ id : store
149
+ run : |
150
+ sha_short=$(git rev-parse --short HEAD)
151
+ branch_name=$(git rev-parse --abbrev-ref HEAD)
152
+ echo "sha_short=$sha_short" >> "$GITHUB_OUTPUT"
153
+ echo "branch=$branch_name" >> "$GITHUB_OUTPUT"
154
+
171
155
store :
172
156
name : Store artifact commit version
173
157
runs-on : ubuntu-latest
174
- needs : [deploy, build]
158
+ needs : [build-and-deploy ]
175
159
steps :
176
160
- name : Checkout
177
161
uses : actions/checkout@v4
0 commit comments