@@ -3,47 +3,42 @@ name: Build & Push SwaggerEditor@next Docker image
33
44on :
55 workflow_run :
6- workflows : ["SwaggerEditor@next build", " SwaggerEditor@next nightly build "]
6+ workflows : ["Release SwaggerEditor@next"]
77 types :
88 - completed
99 branches : [next]
1010
1111jobs :
1212
1313 build-push :
14- if : >
15- github.event.workflow_run.event == 'push' &&
16- github.event.workflow_run.conclusion == 'success'
14+ if : github.event.workflow_run.conclusion == 'success'
1715 name : Build & Push SwaggerEditor@next Docker image
1816 runs-on : ubuntu-latest
1917
2018 steps :
21- - uses : actions/checkout@v3
19+ - name : Checkout
20+ uses : actions/checkout@v3
2221 with :
22+ fetch-depth : 0
23+ persist-credentials : false
24+ submodules : true
2325 ref : next
24- - name : ' Download build artifact'
25- uses : actions/github-script@v6
26+
27+ - name : Setup Node.js
28+ uses : actions/setup-node@v3
2629 with :
27- script : |
28- const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
29- owner: context.repo.owner,
30- repo: context.repo.repo,
31- run_id: context.payload.workflow_run.id,
32- });
33- const matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
34- return artifact.name == "build"
35- })[0];
36- const download = await github.rest.actions.downloadArtifact({
37- owner: context.repo.owner,
38- repo: context.repo.repo,
39- artifact_id: matchArtifact.id,
40- archive_format: 'zip',
41- });
42- const fs = require('fs');
43- fs.writeFileSync('${{github.workspace}}/build.zip', Buffer.from(download.data));
44- - run : |
45- mkdir build
46- unzip build.zip -d build
30+ node-version : 16.16
31+ registry-url : https://npm.pkg.github.com/
32+ scope : " @swagger-api"
33+
34+ - name : Install dependencies
35+ run : npm ci
36+ env :
37+ NODE_AUTH_TOKEN : ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
38+
39+ - name : Build App artifacts
40+ run : npm run build:app
41+
4742 - name : Set up QEMU
4843 uses : docker/setup-qemu-action@v2
4944
0 commit comments