@@ -82,10 +82,12 @@ jobs:
82
82
prerelease : false
83
83
84
84
publish-docker :
85
- needs : release
85
+ needs : [prepare- release, release]
86
86
runs-on : ubuntu-latest
87
87
steps :
88
88
- uses : actions/checkout@v2
89
+ with :
90
+ ref : ' ${{ needs.prepare-release.outputs.version }}'
89
91
- name : Build the Docker image
90
92
run : docker build . --file Dockerfile --build-arg configuration=heroku-fr --tag docker.pkg.github.com/les-projets-cagnottes/web/web:latest
91
93
- name : Login to Registry
@@ -94,10 +96,12 @@ jobs:
94
96
run : docker push docker.pkg.github.com/les-projets-cagnottes/web/web:latest
95
97
96
98
deploy-production :
97
- needs : release
99
+ needs : [prepare- release, release]
98
100
runs-on : ubuntu-latest
99
101
steps :
100
102
- uses : actions/checkout@v2
103
+ with :
104
+ ref : ' ${{ needs.prepare-release.outputs.version }}'
101
105
- name : Use Node.js 10.x
102
106
uses : actions/setup-node@v1
103
107
with :
@@ -133,28 +137,3 @@ jobs:
133
137
key : ${{ secrets.PRODUCTION_KEY }}
134
138
port : ${{ secrets.PRODUCTION_PORT }}
135
139
script : (sudo chmod 755 /opt/les-projets-cagnottes/web/deployment/bin/deploy.sh) && (nohup /opt/les-projets-cagnottes/web/deployment/bin/deploy.sh ${{ steps.get_version.outputs.VERSION }} &> /opt/les-projets-cagnottes/web/deployment/bin/console.log < /dev/null &) && exit 0
136
-
137
- prepare-next-version :
138
- needs : [publish-docker, deploy-production]
139
- runs-on : ubuntu-latest
140
- steps :
141
- - uses : actions/checkout@v2
142
- - name : Set up JDK
143
- uses : actions/setup-java@v1
144
- with :
145
- java-version : 13
146
- server-id : github
147
- settings-path : ${{ github.workspace }}
148
- - name : Get the version
149
- id : get_version
150
- run : " echo ::set-output name=VERSION::$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\" ,]//g' | tr -d '[[:space:]]')"
151
- - name : Get next version
152
- id : get_next_version
153
- run : echo ::set-output name=VERSION::$(bin/increment_version.sh -p ${{ steps.get_version.outputs.VERSION }})
154
- - name : Replace version
155
- run : " sed -i 's/\" version\" : \" ${{ steps.get_version.outputs.VERSION }})\" /\" version\" : \" ${{ steps.get_next_version.outputs.VERSION }}-SNAPSHOT\" /g' package.json"
156
- - name : Push next version
157
- run : git config user.email "${{ secrets.GIT_CONFIG_EMAIL }}" && git config user.name "${{ secrets.GIT_CONFIG_NAME }}"
158
- - run : git add pom.xml
159
- - run : git commit -m "Prepare next version"
160
- - run : git push origin
0 commit comments