build: install eoAPI chart #13
This file contains hidden or 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
| name: Deploy Changes | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| id-token: write | |
| contents: read | |
| actions: read | |
| checks: write | |
| pull-requests: write | |
| env: | |
| AWS_REGION: ${{ vars.AWS_REGION || 'us-east-1' }} | |
| VAR_FILE: ${{ vars.VAR_FILE || 'vars/production.tfvars' }} | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup OpenTofu | |
| uses: opentofu/setup-opentofu@v1 | |
| with: | |
| tofu_wrapper: false | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-region: ${{ env.AWS_REGION }} | |
| role-to-assume: ${{ secrets.AWS_OIDC_ROLE }} | |
| - uses: dorny/paths-filter@v3 | |
| id: changes | |
| with: | |
| list-files: shell | |
| filters: | | |
| tf: 'terraform/**' | |
| manifest: | |
| - added|modified: 'kubernetes/manifests/**' | |
| - name: Provision TF | |
| uses: op5dev/tf-via-pr@v13 | |
| if: ${{ steps.changes.outputs.tf == 'true' }} | |
| with: | |
| command: ${{ github.event_name == 'push' && 'apply' || 'plan' }} | |
| tool: tofu | |
| working-directory: terraform | |
| validate: true | |
| format: true | |
| arg-var-file: ${{ env.VAR_FILE }} | |
| arg-var: cluster_ci_access_role_arn=${{ secrets.AWS_OIDC_ROLE }} | |
| label-pr: false | |
| - name: Get TF Outputs | |
| run: | | |
| echo "S3_BACKUP_ROLE=$(echo tofu -chdir=terraform output -var-file=vars/production.tfvars s3_backup_role)" >> $GITHUB_ENV | |
| echo "CLUSTER_NAME=$(echo tofu -chdir=terraform output -var-file=vars/production.tfvars cluster_name)" >> $GITHUB_ENV | |
| - name: Pull kubeconfig | |
| run: | | |
| aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }} | |
| - name: Apply changed manifests | |
| if: ${{ steps.changes.outputs.manifest == 'true' }} | |
| run: | | |
| kubectl apply -f ${{ steps.filter.outputs.manifest_files }} ${{ github.event_name == 'pull_request' && '--dry-run' || '' }} | |
| - name: Deploy eoAPI Chart | |
| uses: helmfile/helmfile-action@v2.0.4 | |
| with: | |
| helmfile-args: ${{ github.event_name == 'push' && 'apply' || 'diff' }} | |
| helmfile-workdirectory: kubernetes/helm |