Skip to content
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.

reencrypt secrets

reencrypt secrets #43

Workflow file for this run

name: 'Deploy'
on:
workflow_dispatch:
push:
branches:
- main
env:
tf_version: '1.1.8'
tg_version: '0.36.3'
tf_working_dir: './terraform'
jobs:
istio:
name: 'Istio'
runs-on: ubuntu-latest
concurrency: istio
steps:
- name: 'Checkout'
uses: actions/checkout@v1
- name: 'Install sops'
run: |
curl -O -L -C - https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux
sudo mv sops-v3.7.3.linux /usr/bin/sops
sudo chmod +x /usr/bin/sops
- name: 'Install age'
run: |
curl -O -L -C - https://github.com/FiloSottile/age/releases/download/v1.0.0/age-v1.0.0-linux-amd64.tar.gz
tar -zxvf age-v1.0.0-linux-amd64.tar.gz
sudo mv age/age /usr/bin/age
sudo chmod +x /usr/bin/age
- name: 'Install oci-cli'
run: |
curl -L -O https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh
chmod +x install.sh
./install.sh --accept-all-defaults
echo "::add-path::/home/runner/bin"
exec -l $SHELL
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: 'Install istio-cli'
run: |
version=$(cat ./bin/istio-deploy.sh | grep ISTIO_VERSION | head -1 | cut -d "=" -f2 | xargs)
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=${version} sh -
sudo mv ./istio-${version}/bin/istioctl /bin
- name: 'Decrypt secrets'
run: |
./bin/secrets-decrypt.sh
./bin/secrets-setup.sh
env:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
OCI_CLI_CONFIG_FILE: ${{ github.workspace }}/.oci/config
- name: 'Istio deploy'
run: |
./bin/istio-deploy.sh
env:
KUBECONFIG: ${{ github.workspace }}/.kube/admin.live.conf
prometheus:
name: 'Prometheus'
runs-on: ubuntu-latest
concurrency: prometheus
steps:
- name: 'Checkout'
uses: actions/checkout@v1
- name: 'Install sops'
run: |
curl -O -L -C - https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux
sudo mv sops-v3.7.3.linux /usr/bin/sops
sudo chmod +x /usr/bin/sops
- name: 'Install age'
run: |
curl -O -L -C - https://github.com/FiloSottile/age/releases/download/v1.0.0/age-v1.0.0-linux-amd64.tar.gz
tar -zxvf age-v1.0.0-linux-amd64.tar.gz
sudo mv age/age /usr/bin/age
sudo chmod +x /usr/bin/age
- name: 'Install oci-cli'
run: |
curl -L -O https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh
chmod +x install.sh
./install.sh --accept-all-defaults
echo "::add-path::/home/runner/bin"
exec -l $SHELL
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: 'Decrypt secrets'
run: |
./bin/secrets-decrypt.sh
./bin/secrets-setup.sh
env:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
OCI_CLI_CONFIG_FILE: ${{ github.workspace }}/.oci/config
- name: 'Prometheus deploy'
run: |
./bin/prometheus-deploy.sh
env:
KUBECONFIG: ${{ github.workspace }}/.kube/admin.live.conf
terragrunt:
name: 'Terragrunt'
runs-on: ubuntu-latest
concurrency: terragrunt
needs:
- istio
- prometheus
steps:
- name: 'Checkout'
uses: actions/checkout@v1
- name: 'Install sops'
run: |
curl -O -L -C - https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux
sudo mv sops-v3.7.3.linux /usr/bin/sops
sudo chmod +x /usr/bin/sops
- name: 'Install age'
run: |
curl -O -L -C - https://github.com/FiloSottile/age/releases/download/v1.0.0/age-v1.0.0-linux-amd64.tar.gz
tar -zxvf age-v1.0.0-linux-amd64.tar.gz
sudo mv age/age /usr/bin/age
sudo chmod +x /usr/bin/age
- name: 'Install oci-cli'
run: |
curl -L -O https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh
chmod +x install.sh
./install.sh --accept-all-defaults
echo "::add-path::/home/runner/bin"
exec -l $SHELL
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: 'Decrypt secrets'
run: |
./bin/secrets-decrypt.sh
./bin/secrets-setup.sh
env:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
OCI_CLI_CONFIG_FILE: ${{ github.workspace }}/.oci/config
- name: 'Setup terragrunt'
uses: autero1/[email protected]
with:
terragrunt_version: ${{ env.tg_version }}
- name: 'Setup terraform'
uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ env.tf_version }}
- name: 'Terragrunt init'
run: |
./bin/terraform-init.sh
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: 'Terragrunt validate'
run: |
./bin/terraform-validate.sh
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: 'Terragrunt plan'
run: |
./bin/terraform-plan.sh
env:
KUBECONFIG: ${{ github.workspace }}/.kube/admin.live.conf
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: 'Terragrunt apply'
run: |
./bin/terraform-apply.sh
env:
KUBECONFIG: ${{ github.workspace }}/.kube/admin.live.conf
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# TODO trigger zelos-configuration action: https://blog.marcnuri.com/triggering-github-actions-across-different-repositories