ci/cd - fix secret key

This commit is contained in:
florian 2023-08-31 08:17:56 +02:00
parent 0e2420cfff
commit 64d2ed91ec
4 changed files with 11 additions and 1 deletions

View File

@ -9,6 +9,10 @@ on:
secrets:
CICD_SECRETS:
required: true
SECRET_KEY:
required: true
K8S_IP:
required: true
jobs:
create:
@ -43,6 +47,7 @@ jobs:
CICD_SECRETS: ${{ secrets.CICD_SECRETS }}
REG_USER: ${{ github.actor }}
REG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
K8S_IP: ${{ secrets.K8S_IP }}
- run: |
tar -cf terraform.tar /tmp/${{ inputs.TYPE }}
echo "$SECRET_KEY" > /tmp/.secret_key

View File

@ -9,6 +9,8 @@ on:
secrets:
CICD_SECRETS:
required: true
SECRET_KEY:
required: true
jobs:
delete:
@ -21,7 +23,6 @@ jobs:
uses: actions/checkout@v3
- name: Install terraform
uses: hashicorp/setup-terraform@v2
- uses: actions/download-artifact@v3
with:
name: tf-${{ inputs.TYPE }}

View File

@ -100,6 +100,8 @@ jobs:
TYPE: ${{ matrix.type }}
secrets:
CICD_SECRETS: ${{ secrets.CICD_SECRETS }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
K8S_IP: ${{ secrets.K8S_IP }}
# Perform tests
staging-tests:
@ -163,6 +165,7 @@ jobs:
TYPE: ${{ matrix.type }}
secrets:
CICD_SECRETS: ${{ secrets.CICD_SECRETS }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
# Push Docker images
push-images:

View File

@ -4,6 +4,7 @@
echo "${CICD_SECRETS}" > /opt/.env
echo "export TF_VAR_k8s_reg_user=${REG_USER}" >> /opt/.env
echo "export TF_VAR_k8s_reg_token=${REG_TOKEN}" >> /opt/.env
echo "export TF_VAR_k8s_ip=${K8S_IP}" >> /opt/.env
chmod +x /opt/.env
. /opt/.env