Update ArgoCD module #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release-genval-artifacts | |
on: | |
push: | |
tags: | |
- 'v*' | |
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: install 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 | |
# Publish Genval Rego polcies | |
- name: Push Dockerfile policies | |
id: push_dockerfile_policies | |
if: ${{ contains(github.event.head.commit_modified, 'genval/defaultpolicies/rego/dockerfile_policies/**') }} | |
run: | | |
GIT_TAG=${{ env.tag }} | |
GENVAL_OUTPUT=$(genval artifact push --reqinput ./genval/defaultpolicies/rego/dockerfile_policies\ \ | |
--dest oci://ghcr.io/intelops/policyhub/genval/dockerfile_policies:${GIT_TAG} \ | |
--annotations="authors=intelops inc") | |
echo "${GENVAL_OUTPUT}" | |
echo "dockerfile_artifact_url=oci://ghcr.io/intelops/policyhub/genval/dockerfile_policies:${GIT_TAG}" >> $GITHUB_ENV | |
- name: Use Dockerfile Policies URL | |
run: | | |
echo "Dockerfile artifact URL: ${{ env.dockerfile_artifact_url }}" | |
- name: Push Dockerfile Input policies | |
id: push_dockerfile_input_policies | |
if: ${{ contains(github.event.head.commit_modified, 'genval/defaultpolicies/rego/input_policies/**') }} | |
run: | | |
GIT_TAG=${{ env.tag }} | |
GENVAL_OUTPUT=$(genval artifact push --reqinput ./genval/defaultpolicies/rego/input_policies\ \ | |
--dest oci://ghcr.io/intelops/policyhub/genval/dockerfile_input_policies:${GIT_TAG} \ | |
--annotations="authors=intelops inc") | |
echo "${GENVAL_OUTPUT}" | |
echo "dockerfile_input_artifact_url=oci://ghcr.io/intelops/policyhub/genval/dockerfile_input_policies:${GIT_TAG}" >> $GITHUB_ENV | |
- name: Use Dockerfile Input policies URL | |
run: | | |
echo Input Policies artifact URL: ${{ env.dockerfile_input_artifact_url }}" | |
- name: Push Infrafile policies | |
id: push_infrafile_policies | |
if: ${{ contains(github.event.head.commit_modified, 'genval/defaultpolicies/rego/infrafile_policies/**') }} | |
run: | | |
GIT_TAG=${{ env.tag }} | |
GENVAL_OUTPUT=$(genval artifact push --reqinput ./genval/defaultpolicies/rego/infrafile_policies\ \ | |
--dest oci://ghcr.io/intelops/policyhub/genval/infrafile_policies:${GIT_TAG} \ | |
--annotations="authors=intelops inc) | |
echo "${GENVAL_OUTPUT}" | |
echo "infrafile_artifact_url=oci://ghcr.io/intelops/policyhub/genval/infrafile_policies:${GIT_TAG}" >> $GITHUB_ENV | |
- name: Use Infrafile Policies artifact URL | |
run: | | |
echo "Infrafile policies artifact URL: ${{ env.infrafile_artifact_url }}" | |
- name: Push Terraform policies | |
id: push_terraform_policies | |
if: ${{ contains(github.event.head.commit_modified, 'genval/defaultpolicies/rego/terrraform_policies/**') }} | |
run: | | |
GIT_TAG=${{ env.tag }} | |
GENVAL_OUTPUT=$(genval artifact push --reqinput ./genval/defaultpolicies/rego/terraform_policies\ \ | |
--dest oci://ghcr.io/intelops/policyhub/genval/terraform_policies:${GIT_TAG} \ | |
--annotations="authors=intelops inc") | |
echo "${GENVAL_OUTPUT}" | |
echo "terraform_artifact_url=oci://ghcr.io/intelops/policyhub/genval/terraform_policies:${GIT_TAG}" >> $GITHUB_ENV | |
- name: Use Terraform Policies artifact URL | |
run: | | |
echo "Terraform Policies artifact URL: ${{ env.terraform_artifact_url }}" | |
# Publish Genval cuemods | |
- name: Push k8s module | |
id: push_k8s_module | |
if: ${{ contains(github.event.head.commit_modified, 'genval/modules/cuemod-k8s:*/**') }} | |
run: | | |
GIT_TAG=${{ env.tag }} | |
GENVAL_OUTPUT=$(genval artifact push --reqinput ./genval/modules/cuemod-k8s:v1.30 \ | |
--dest oci://ghcr.io/intelops/policyhub/genval/k8s-cuemods:${GIT_TAG} \ | |
--annotations="authors=intelops inc") | |
echo "${GENVAL_OUTPUT}" | |
echo "k8s-module_artifact_url=oci://ghcr.io/intelops/policyhub/genval/k8s-cuemods:${GIT_TAG}" >> $GITHUB_ENV | |
- name: Use K8s module artifact URL | |
run: | | |
echo "K8s module artifact URL: ${{ env.k8s_module_artifact_url }}" | |
- name: Push ArgoCD module | |
id: push_argocd_module | |
if: ${{ contains(github.event.head.commit_modified, 'genval/modules/cuemod-argocd:*/**') }} | |
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 "argocd_module_artifact_url=oci://ghcr.io/intelops/policyhub/genval/argocd-cuemods:${GIT_TAG}" >> $GITHUB_ENV | |
- name: Use ArgoCD module artifact URL | |
run: | | |
echo "ArgoCD module artifact URL: ${{ env.argocd_module_artifact_url }}" | |
- name: Push TektonCD module | |
id: push_tektoncd_module | |
if: ${{ contains(github.event.head.commit_modified, 'genval/modules/cuemod-tektoncd:*/**') }} | |
run: | | |
GIT_TAG=${{ env.tag }} | |
GENVAL_OUTPUT=$(genval artifact push --reqinput ./genval/modules/cuemod-tektoncd:v0.60.2 \ | |
--dest oci://ghcr.io/intelops/policyhub/genval/argocd-cuemods:$GIT_TAG} \ | |
--annotations="authors=intelops Inc." | |
echo "${GENVAL_OUTPUT}" | |
echo "tektoncd_module_artifact_url=oci://ghcr.io/intelops/policyhub/genval/tektoncd-cuemods:${GIT_TAG}" >> $GITHUB_ENV | |
- name: Use TektonCD module artifact URL | |
run: | | |
echo "TektonCD module artifact URL: ${{ env.tektoncd_module_artifact_url }}" |