Skip to content

Merge pull request #117 from hotosm/fix/worker-disk-size #208

Merge pull request #117 from hotosm/fix/worker-disk-size

Merge pull request #117 from hotosm/fix/worker-disk-size #208

Workflow file for this run

name: Deploy Changes
on:
push:
paths:
- kubernetes/**
- terraform/**
branches:
- main
pull_request:
paths:
- kubernetes/**
- terraform/**
branches:
- main
permissions:
id-token: write
contents: read
actions: read
checks: write
pull-requests: write
# Only allow one run at a time, to avoid corrupting state
concurrency:
group: terraform-main
cancel-in-progress: false
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_version: '1.10.5'
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
env:
TF_VAR_cluster_ci_access_role_arn: ${{ secrets.AWS_OIDC_ROLE }}
TF_VAR_cluster_admin_access_role_arns: ${{ secrets.CLUSTER_ADMIN_ACCESS_ROLE_ARNS }}
with:
command: ${{ github.event_name == 'push' && 'apply' || 'plan' }}
tool: tofu
working-directory: terraform
validate: true
format: true
arg-var-file: ${{ env.VAR_FILE }}
- 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 }}
- name: Apply manifests
run: |
kubectl apply -f kubernetes/manifests/ ${{ github.event_name == 'pull_request' && '--dry-run=client' || '' }}
- name: Deploy eoAPI Chart
uses: helmfile/helmfile-action@v2.1.1
with:
helmfile-args: ${{ github.event_name == 'push' && 'apply' || 'diff' }}
helmfile-workdirectory: kubernetes/helm