Skip to content

Deploy

Deploy #4

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
inputs:
mode:
description: supported values are 'apply' and 'plan'
required: true
jobs:
terraform:
runs-on: ubuntu-latest
env:
# Secrets
TF_VAR_blockfrost_key: ${{ secrets.DEV_BLOCKFROST_KEY }}
TF_VAR_dmtr_api_key: ${{ secrets.DEV_DMTR_API_KEY }}
TF_VAR_admin_key: ${{ secrets.DEV_HYDRA_ADMIN_KEY }}
# Vars
TF_VAR_dmtr_port_name: preprod-4raar2
TF_VAR_dmtr_project_id: b55545f5-31e7-4e6b-81d6-22f4e6b5a144
TF_VAR_external_domain: us-east-1.hydra-doom.sundae.fi
TF_VAR_hydra_node_image: ghcr.io/cardano-scaling/hydra-node:latest
TF_VAR_eks_cluster_arn: arn:aws:eks:us-east-1:509399595051:cluster/hydra-doom-dev-cluster
TF_VAR_hydra_scripts_tx_id: 03f8deb122fbbd98af8eb58ef56feda37728ec957d39586b78198a0cf624412a
TF_VAR_admin_addr: addr_test1vpgcjapuwl7gfnzhzg6svtj0ph3gxu8kyuadudmf0kzsksqrfugfc
steps:
- uses: actions/checkout@v2
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-1
aws-access-key-id: ${{ secrets.DEPLOY_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEPLOY_AWS_SECRET_ACCESS_KEY }}
- name: Get short commit sh
id: image_tag
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: setup kubeconfig
run: aws eks update-kubeconfig --name ${{ vars.AWS_CLUSTER_NAME }}
- name: setup terraform
uses: hashicorp/setup-terraform@v3
- name: init terraform
working-directory: playbook/doom-dev
run: terraform init
env:
TF_VAR_image: ghcr.io/cardano-scaling/hydra-control-plane:${{ steps.image_tag.outputs.sha_short }}
- name: validate terraform
working-directory: playbook/doom-dev
run: terraform validate
env:
TF_VAR_image: ghcr.io/cardano-scaling/hydra-control-plane:${{ steps.image_tag.outputs.sha_short }}
- name: plan terraform
working-directory: playbook/doom-dev
if: inputs.mode == 'plan'
run: terraform plan -input=false
env:
TF_VAR_image: ghcr.io/cardano-scaling/hydra-control-plane:${{ steps.image_tag.outputs.sha_short }}
- name: apply terraform
working-directory: playbook/doom-dev
if: inputs.mode == 'apply'
run: terraform apply -auto-approve -input=false
env:
TF_VAR_image: ghcr.io/cardano-scaling/hydra-control-plane:${{ steps.image_tag.outputs.sha_short }}