Skip to content

Commit

Permalink
Refactor policy container workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
garryod committed Apr 11, 2024
1 parent 2f7448b commit 69affbd
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/policy-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,24 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup OPA
uses: open-policy-agent/setup-opa@v2.2.0
with:
version: latest

- name: Build OPA Policy # If this is a tag, use it as a revision string
run: opa build -b org-policy -r ${{ github.ref_name }} --ignore *_test.rego

- name: Build OPA Policy
run: >
opa
build
--bundle org-policy
--revision ${{ github.ref_name }}
--ignore *_test.rego
- name: Publish OPA Bundle
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
run: oras push ${{ env.IMAGE_REPOSITORY }}:${{ github.ref_name }} bundle.tar.gz:application/vnd.oci.image.layer.v1.tar+gzip
run: >
oras
push
${{ env.IMAGE_REPOSITORY }}:${{ github.ref_name }}
bundle.tar.gz:application/vnd.oci.image.layer.v1.tar+gzip

0 comments on commit 69affbd

Please sign in to comment.