-
Notifications
You must be signed in to change notification settings - Fork 25
48 lines (46 loc) · 1.83 KB
/
publish-4x-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: "Publish images to 4.x and 4.x-rootless tags"
on:
workflow_dispatch:
inputs:
image_tag:
description: Image tag on dockerhub to promote to the puppet-dev-tools 4.x image tag (ie. 2021-06-29-da6666a)
required: true
image_tag_rootless:
description: Image tag on dockerhub to promote to the puppet-dev-tools 4.x-rootless image tag (ie. 2021-06-29-da6666a-rootless)
required: true
jobs:
publish-4x-image:
runs-on: ubuntu-latest
env:
IMAGE_BASE: "${{ secrets.DOCKERHUB_PUSH_USERNAME }}/puppet-dev-tools"
steps:
- name: Login to Docker Hub
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_LOGIN_USERNAME }} --password-stdin
- name: Pull image
env:
IMAGE_TAG: ${{ github.event.inputs.image_tag }}
run: |
docker pull ${IMAGE_BASE}:${IMAGE_TAG}
- name: Trivy scan
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.IMAGE_BASE }}:${{ github.event.inputs.image_tag }}
exit-code: 1
ignore-unfixed: true
severity: 'CRITICAL,HIGH,MEDIUM'
vuln-type: os
timeout: 10m0s
skip-files: "/root/.pdk/cache/ruby/*/gems/aws-sdk-core-*/lib/aws-sdk-ssooidc/client.rb"
- name: Publish standard image to 4.x
env:
IMAGE_TAG: ${{ github.event.inputs.image_tag }}
run: |
docker tag ${IMAGE_BASE}:${IMAGE_TAG} ${IMAGE_BASE}:4.x
docker push ${IMAGE_BASE}:4.x
- name: Publish rootless image to 4.x-rootless
env:
IMAGE_TAG: ${{ github.event.inputs.image_tag_rootless }}
run: |
docker pull ${IMAGE_BASE}:${IMAGE_TAG}
docker tag ${IMAGE_BASE}:${IMAGE_TAG} ${IMAGE_BASE}:4.x-rootless
docker push ${IMAGE_BASE}:4.x-rootless