Skip to content

Commit

Permalink
actions
Browse files Browse the repository at this point in the history
  • Loading branch information
james-otten committed Apr 28, 2024
1 parent a4a5c3b commit c998325
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/checkov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Checkov
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

permissions: read-all
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/helm_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Lint and Test Chart

Check failure on line 1 in .github/workflows/helm_lint.yaml

View workflow job for this annotation

GitHub Actions / checkov-action

CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"

Check failure

Code scanning / checkov

Ensure top-level permissions are not set to write-all Error

Ensure top-level permissions are not set to write-all

on: pull_request

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.14.0

- uses: actions/setup-python@v4
with:
python-version: '3.12'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
16 changes: 16 additions & 0 deletions .github/workflows/publish-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,19 @@ jobs:
if_key_exists: fail # replace / ignore / fail; optional (defaults to fail)
- name: Pull new Docker image
run: ssh ${{ secrets.GRANDSVC_SSH_TARGET }} "cd ${{ secrets.GRANDSVC_PROJECT_PATH }} && git pull && docker compose pull && docker compose up -d"

deploy_to_dev0:
name: Deploy to dev0
needs: push_to_registry
runs-on: ubuntu-latest
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 # v2
with:
key: ${{ secrets.DEV0_KEY }}
name: id_ed25519 # optional
known_hosts: ${{ secrets.DEV0_KNOWN_HOSTS }}
#config: ${{ secrets.CONFIG }} # ssh_config; optional
if_key_exists: fail # replace / ignore / fail; optional (defaults to fail)
- name: Pull new Docker image
run: ssh ${{ secrets.DEV0_SSH_TARGET }} "cd ${{ secrets.DEV0_PROJECT_PATH }} && git pull && cd infra/helm/meshdb && helm template . -f values.yaml -f ${{ secrets.DEV0_HELM_SECRETS_PATH }} | kubectl apply -f -"

0 comments on commit c998325

Please sign in to comment.