build: install eoAPI chart #19
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 }} | |
| - name: Provision TF | |
| uses: op5dev/tf-via-pr@v13 | |
| with: | |
| ## Final two steps depend on fully provisioned cluster | |
| ## Revert to original condition once the cluster is up | |
| command: apply | |
| # 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=$(tofu -chdir=terraform output -var-file=vars/production.tfvars s3_backup_role)" >> $GITHUB_ENV | |
| echo "CLUSTER_NAME=$(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 }} | |
| ## Final two steps depend on fully provisioned cluster | |
| ## Reenable once the cluster is up | |
| # - name: Apply manifests | |
| # run: | | |
| # kubectl apply -f kubernetes/manifests/ ${{ 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 |