1+ name : Build and deploy CI for QA
2+
3+ on : workflow_dispatch
4+
5+ jobs :
6+ buildqa :
7+ runs-on : ubuntu-latest
8+
9+ steps :
10+ - name : Extract branch name
11+ shell : bash
12+ run : echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
13+ id : extract_branch
14+ - uses : actions/checkout@v2
15+ - name : Set up JDK 1.8
16+ uses : actions/setup-java@v1
17+ with :
18+ java-version : 1.8
19+ - name : go to demoqa
20+ run : cd ./demoqa
21+ - name : Grant execute permission for gradlew
22+ run : chmod +x gradlew
23+ working-directory : ./demoqa
24+ - name : change branch
25+ run : sed -i 's/%branch%/${{ steps.extract_branch.outputs.branch }}/g' ./src/main/resources/static/index.html
26+ working-directory : ./demoqa
27+ # - name: Gradle wrapper
28+ # run: gradle wrapper
29+ # working-directory: ./demoqa
30+ - name : Clean
31+ run : ./gradlew clean
32+ working-directory : ./demoqa
33+ - name : Assemble
34+ run : ./gradlew assemble
35+ working-directory : ./demoqa
36+ - name : test
37+ run : ./gradlew test
38+ working-directory : ./demoqa
39+ - uses : actions/upload-artifact@v2
40+ with :
41+ name : demoqa-jar
42+ path : ./demoqa/build/libs/demoqa-0.0.1.jar
43+
44+ deployqa :
45+ needs : buildqa
46+ runs-on : ubuntu-latest
47+
48+ steps :
49+ - name : Extract branch name
50+ shell : bash
51+ run : echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
52+ id : extract_branch
53+
54+ - uses : actions/checkout@v2
55+
56+ - uses : actions/download-artifact@v2
57+ with :
58+ name : demoqa-jar
59+ path : ./demoqa
60+
61+ - name : Login to Registry
62+ uses : docker/login-action@v1
63+ with :
64+ registry : ghcr.io
65+ username : ${{ github.repository_owner }}
66+ password : ${{ secrets.DOCKER_QA }}
67+
68+ # hashtag pour les gars
69+
70+ - name : Build and push Docker image
71+ 72+ with :
73+ push : true
74+ tags : ghcr.io/${{ github.repository }}:QA
75+ context : ./demoqa
0 commit comments