From e5765d01d9d719b34924785786b10dbb1b8885c4 Mon Sep 17 00:00:00 2001 From: Dorian Date: Wed, 31 Jan 2024 00:15:22 +0100 Subject: [PATCH] ci_cd,s3 backend --- .github/workflows/cd.yml | 30 ------------------------------ .github/workflows/ci.yml | 18 ------------------ .github/workflows/ci_cd.yml | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/cd.yml delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/ci_cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml deleted file mode 100644 index 9de9b11..0000000 --- a/.github/workflows/cd.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: CD - -on: -# Only trigger, when the build workflow succeeded - workflow_run: - workflows: [CI] - types: - - completed - -jobs: - deploy_terraform: - runs-on: ubuntu-latest - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - steps: - - name: chechout repo - uses: actions/checkout@v2 - - - name: Init terraform - run: make infra-init - - - name: Terraform apply - run: make infra-apply - - - - - - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 98127d2..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: CI -on: - push: - branches: - - iac_branch - pull_request: - branches: - - iac_branch -jobs: - run-ci-tests: - runs-on: ubuntu-latest - steps: - - name: checkout repo - uses: actions/checkout@v2 - - name: Spin up containers - run: make up - - name: Run CI test - run: make ci \ No newline at end of file diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml new file mode 100644 index 0000000..6d447f5 --- /dev/null +++ b/.github/workflows/ci_cd.yml @@ -0,0 +1,35 @@ +name: ci_cd +on: + push: + branches: + - iac_branch + pull_request: + branches: + - iac_branch +jobs: + run-ci-tests: + runs-on: ubuntu-latest + steps: + - name: checkout repo + uses: actions/checkout@v2 + + - name: Spin up containers + run: make up + + - name: Run CI test + run: make ci + + deploy_terraform: + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + steps: + - name: chechout repo + uses: actions/checkout@v2 + + - name: Init terraform + run: make infra-init + + - name: Terraform apply + run: make infra-apply \ No newline at end of file