Skip to content

Commit

Permalink
Migrate infra code to ai-validation-infra and write deploy Github act… (
Browse files Browse the repository at this point in the history
  • Loading branch information
berrydenhartog authored Aug 6, 2024
2 parents b5967d1 + 65c2304 commit f9a9f3b
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 80 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: deploy

on:
workflow_run:
workflows: ["build"]
types:
- completed

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Get GHCR package hash
id: get_package_hash
run: |
container_id=$(gh api --paginate -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /orgs/MinBZK/packages/container/ai-act-beslisboom/versions | jq -r '.[] | select(.metadata.container.tags | contains(["main"])) | .name')
echo "container_id=$container_id" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: check correct name
run: |
if [ -z "${{steps.get_package_hash.outputs.container_id}}" ]; then
echo "Variable is empty. Failing the workflow."
exit 1
fi
- uses: actions/checkout@v4
with:
repository: 'minbzk/ai-validation-infra'
ref: main
token: ${{ secrets.GH_PAT }}

- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Make changes to the file
run: |
sed -i 's/newTag: .*$/newTag: main@${{ steps.get_package_hash.outputs.container_id }}/g' apps/ai-act-beslisboom/sandbox/kustomization.yaml
sed -i 's|minbzk.github.io/version: .*$|minbzk.github.io/version: main|g' apps/ai-act-beslisboom/sandbox/kustomization.yaml
git add apps/ai-act-beslisboom/sandbox/kustomization.yaml
- name: show changes
run: git diff --staged

- name: push changes
run: |
git commit -m "Update ai-act-beslisboom sandbox tag ${{ steps.get_package_hash.outputs.container_id }}"
git push --force-with-lease
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# AI-act-beslisboom

Deze git repository bevat de beslisboom op basis van de AI Verordening. Het project omvat 3 onderdelen.
Deze git repository bevat de beslisboom op basis van de AI Verordening. Het project omvat 2 onderdelen.

1. De beslisboom: [decision-tree.yaml](decision-tree.yaml)
2. Een frontend voor de visualisatie van de beslisboom: [frontend](frontend/)
3. Kubernetes deployment code: [infra](infra/)

De Kubernetes deployment code staat bij [infra](https://github.com/MinBZK/ai-validation-infra/apps/ai-act-beslisboom)

Door deze beslisboom te doorlopen, krijgt uw organisatie inzicht in de volgende vragen:

Expand Down
27 changes: 0 additions & 27 deletions infra/deployment.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions infra/ingress.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions infra/kustomization.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions infra/service.yaml

This file was deleted.

0 comments on commit f9a9f3b

Please sign in to comment.