forked from puppetlabs/community_management
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (70 loc) · 2.1 KB
/
build-release-policy.yaml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: build-release
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
release_policy:
runs-on: ubuntu-latest
name: build
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Read config
id: config
uses: opcr-io/[email protected]
with:
file: .github/config.yaml
- name: List Sver Tags
uses: aserto-dev/sver-action@v0
id: "sver"
with:
docker_image: ${{ steps.config.outputs.repo }}
docker_registry: ${{ steps.config.outputs.server }}
docker_username: ${{ steps.config.outputs.username }}
docker_password: ${{ secrets.ASERTO_PUSH_KEY }}
- name: Calculate image tags
id: "tags"
run: |
while read -r tag; do
tags="$tags ${{ steps.config.outputs.repo }}:$tag"
done < <(echo "${{ steps.sver.outputs.version }}")
echo ::set-output name=target_tags::$tags
- name: Policy Login
id: policy-login
uses: opcr-io/policy-login-action@v2
with:
username: ${{ steps.config.outputs.username }}
password: ${{ secrets.ASERTO_PUSH_KEY }}
server: ${{ steps.config.outputs.server }}
- name: Policy Build
id: policy-build
uses: opcr-io/policy-build-action@v2
with:
src: src
tag: ${{ steps.config.outputs.repo }}
revision: "$GITHUB_SHA"
env:
POLICY_DEFAULT_DOMAIN: ${{ steps.config.outputs.server }}
- name: Policy Tag
id: policy-tag
uses: opcr-io/policy-tag-action@v2
with:
source_tag: ${{ steps.config.outputs.repo }}
target_tags: ${{ steps.tags.outputs.target_tags }}
env:
POLICY_DEFAULT_DOMAIN: ${{ steps.config.outputs.server }}
- name: Policy Push
id: policy-push
uses: opcr-io/policy-push-action@v2
with:
tags: ${{ steps.tags.outputs.target_tags }}
env:
POLICY_DEFAULT_DOMAIN: ${{ steps.config.outputs.server }}
- name: Policy Logout
id: policy-logout
uses: opcr-io/policy-logout-action@v2
with:
server: ${{ steps.config.outputs.server }}