Skip to content

Commit 6db9b78

Browse files
committedOct 8, 2021
ci: add release job
1 parent ca5536a commit 6db9b78

File tree

1 file changed

+45
-12
lines changed

1 file changed

+45
-12
lines changed
 

‎.github/workflows/release.yml

+45-12
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ jobs:
6363
name: testimage
6464
path: /tmp/test.tar
6565

66-
- name: Push Docker image
67-
uses: docker/build-push-action@v2.7.0
68-
with:
69-
context: .
70-
push: ${{ github.event_name == 'release' }}
71-
tags: ${{ steps.meta.outputs.tags }}
72-
labels: ${{ steps.meta.outputs.labels }}
73-
7466
molecule:
7567
needs:
7668
- build
@@ -87,10 +79,9 @@ jobs:
8779
docker load --input /tmp/test.tar
8880
docker image ls -a
8981
90-
- name: Test run Molecule from DockerHub latest image
91-
uses: docker://gofrolist/molecule:test
92-
with:
93-
molecule_options: --version
82+
- name: Test run Molecule
83+
run: |
84+
docker run --rm ${{ env.DOCKER_IMAGE_NAME }}:test molecule --version
9485
9586
snyk:
9687
needs:
@@ -125,3 +116,45 @@ jobs:
125116
uses: github/codeql-action/upload-sarif@v1
126117
with:
127118
sarif_file: snyk.sarif
119+
120+
release:
121+
needs:
122+
- build
123+
- molecule
124+
runs-on: ubuntu-20.04
125+
steps:
126+
- name: Download artifact
127+
uses: actions/download-artifact@v2.0.10
128+
with:
129+
name: testimage
130+
path: /tmp
131+
132+
- name: Load image
133+
run: |
134+
docker load --input /tmp/test.tar
135+
docker image ls -a
136+
137+
- name: Push Docker image
138+
uses: docker/build-push-action@v2.7.0
139+
with:
140+
context: .
141+
push: ${{ github.event_name == 'release' }}
142+
tags: ${{ steps.meta.outputs.tags }}
143+
labels: ${{ steps.meta.outputs.labels }}
144+
cache-from: type=gha
145+
cache-to: type=gha,mode=max
146+
147+
- name: Test run Molecule from DockerHub latest image
148+
uses: docker://gofrolist/molecule:latest
149+
with:
150+
molecule_options: --version
151+
152+
- name: Setup Node.js
153+
uses: actions/setup-node@v2.3.2
154+
with:
155+
node-version: '14'
156+
157+
- name: Release
158+
env:
159+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
160+
run: npx semantic-release -p @semantic-release/commit-analyzer -p @semantic-release/release-notes-generator -p @semantic-release/github --dry-run

0 commit comments

Comments
 (0)
Please sign in to comment.