Skip to content

Test conditionals

Test conditionals #5

name: dockerfile-ci
on:
push:
tags:
- 'branches'
paths:
- 'genval/defaultpolicies/rego/dockerfile_policies/**'
tags:
- 'v*'
if: |
(startswith(github.ref, 'refd/tags/'') &&
"github.ref == 'refs/head/master'" &&
"contains(github.event.head_commit.modified, 'genval/defaultpolicies/rego/dockerfile_policies/**')")
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: push-rego-policies
run: |
genval artifact push --reqinput ./genval/defaultpolicies/rego/dockerfile_policies \
--dest oci://ghcr.io/intelops/policyhub/genval/dockerfile_policies:v0.0.1 \
--annotations="authors=intelops Inc."