add action for pushing policies #1
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
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: Lint policies | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup OPA | |
uses: open-policy-agent/[email protected] | |
with: | |
version: 0.61 | |
- name: Setup Regal | |
uses: StyraInc/[email protected] | |
with: | |
version: 0.21 | |
- name: OPA Check | |
if: ${{ !cancelled() }} | |
run: opa check --strict --max-errors 0 . | |
- name: Regal Lint | |
if: ${{ !cancelled() }} | |
run: regal lint --format github . | |
deploy: | |
name: Deploy policies | |
runs-on: ubuntu-latest | |
needs: lint | |
if: success() && github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Upload | |
run: .github/workflows/upload.py |