-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.72 KB
/
publish-argocd-latest-modules.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
name: ArgoCD-modules-ci
on:
push:
tags:
- 'branches'
paths:
- 'genval/modules/cuemod-argocd:v2.11.3/**'
tags:
- 'v*'
if: |
(startswith(github.ref, 'refd/tags/'') &&
"github.ref == 'refs/head/master'" &&
"contains(github.event.head_commit.modified, 'genval/modules/cuemod-argocd:v2.11.3/**')")
permissions:
contents: write
security-events: write
# Optional: allow read access to pull request. Use with `only-new-issues` option.
packages: write
jobs:
push-artifact:
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22'
cache: false
- name: inetall genval
run: go install github.com/intelops/genval@main
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch Git tag
id: get_tag
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Push rego policies
id: push_policies
run: |
GIT_TAG=${{ env.tag }}
GENVAL_OUTPUT=$(genval artifact push --reqinput ./genval/modules/cuemod-argocd:v2.11.3 \
--dest oci://ghcr.io/intelops/policyhub/genval/argocd-cuemods:${GIT_TAG} \
--annotations="authors=intelops Inc.")
echo "${GENVAL_OUTPUT}"
echo "artifact URL=oci://ghcr.io/intelops/policyhub/genval/argocd-cuemods:${GIT_TAG}" >> ${GITHUB_ENV}
- name: Use artifact URL
run: |
echo "Artifact URL is: ${{ env.artifact_url }}"