build: install eoAPI chart #12
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 Terraform | |
| 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/**' | |
| eoapi: 'kubernetes/helm/eoapi.yaml' | |
| 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: Pull kubeconfig | |
| run: make kubeconfig | |
| - 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: Pull chart inputs | |
| run: | | |
| echo "S3_BACKUP_ROLE=$(echo tofu -chdir=terraform output s3_backup_role)" >> $GITHUB_ENV | |
| echo "CLUSTER_NAME=$(echo tofu -chdir=terraform output cluster_name)" >> $GITHUB_ENV | |
| - name: Deploy eoAPI Chart | |
| uses: bitovi/github-actions-deploy-eks-helm@v1.2.12 | |
| if: ${{ steps.changes.outputs.eoapi == 'true' }} | |
| with: | |
| aws-region: ${{ env.AWS_REGION }} | |
| cluster-name: ${{ env.CLUSTER_NAME }} | |
| config-files: kubernetes/helm/eoapi.yaml | |
| chart-path: eoapi/eoapi | |
| namespace: eoapi | |
| create-namespace: true | |
| name: eoapi | |
| chart-repository: https://devseed.com/eoapi-k8s/ | |
| values: | | |
| previousVersion=0.7.1 | |
| postgrescluster.metadata.annotations."eks\.amazonaws\.com/role-arn"=${{ env.S3_BACKUP_ROLE }} | |
| version: 0.7.1 | |
| dry-run: ${{ github.event_name == 'pull_request' }} |