debug: #54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Main | |
| on: | |
| push: | |
| branches: | |
| - feat/* | |
| - fix/* | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - prod | |
| - dev | |
| jobs: | |
| setenv: | |
| name: Set Environment | |
| runs-on: ubuntu-latest | |
| outputs: | |
| env: ${{ steps.setenv.outputs.env }} | |
| steps: | |
| - name: Set env | |
| id: setenv | |
| run: | | |
| BRANCH="${{ github.head_ref || github.ref_name }}" | |
| if [[ "$BRANCH" == "prod" ]]; then | |
| echo "env=prod" >> $GITHUB_OUTPUT | |
| else | |
| echo "env=dev" >> $GITHUB_OUTPUT | |
| fi | |
| terraform-checkov: | |
| name: Terraform Checkov | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@master | |
| - name: Checkov Terraform | |
| uses: bridgecrewio/checkov-action@master | |
| with: | |
| directory: ./terraform/ | |
| continue-on-error: true | |
| terraform-plan: | |
| name: Terraform for ${{ needs.setenv.outputs.env }} | |
| needs: | |
| - setenv | |
| - terraform-checkov | |
| uses: ./.github/workflows/terraform_plan.yml | |
| with: | |
| environment: ${{ needs.setenv.outputs.env }} | |
| secrets: | |
| TOKEN: ${{ secrets.TOKEN }} | |
| CLOUD: ${{ secrets.CLOUD }} | |
| FOLDER: ${{ secrets.FOLDER }} | |
| DOMAIN: ${{ secrets.DOMAIN }} | |
| PUBLIC_SSH_KEY: ${{ secrets.PUBLIC_SSH_KEY }} | |
| BUCKET: ${{ secrets.BUCKET }} | |
| ACCESS_KEY: ${{ secrets.ACCESS_KEY }} | |
| SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
| terraform-apply: | |
| name: Terraform for ${{ needs.setenv.outputs.env }} | |
| needs: | |
| - setenv | |
| - terraform-plan | |
| uses: ./.github/workflows/terraform_apply.yml | |
| with: | |
| environment: ${{ needs.setenv.outputs.env }} | |
| secrets: | |
| TOKEN: ${{ secrets.TOKEN }} | |
| CLOUD: ${{ secrets.CLOUD }} | |
| FOLDER: ${{ secrets.FOLDER }} | |
| DOMAIN: ${{ secrets.DOMAIN }} | |
| PUBLIC_SSH_KEY: ${{ secrets.PUBLIC_SSH_KEY }} | |
| BUCKET: ${{ secrets.BUCKET }} | |
| ACCESS_KEY: ${{ secrets.ACCESS_KEY }} | |
| SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
| ansible-lint: | |
| name: Ansible Lint | |
| uses: ./.github/workflows/ansible_lint.yml | |
| ansible-playbook: | |
| name: Ansible for ${{ needs.setenv.outputs.env }} | |
| needs: | |
| - setenv | |
| - ansible-lint | |
| - terraform-apply | |
| uses: ./.github/workflows/ansible_playbook.yml | |
| with: | |
| environment: ${{ needs.setenv.outputs.env }} | |
| secrets: | |
| TOKEN: ${{ secrets.TOKEN }} | |
| CLOUD: ${{ secrets.CLOUD }} | |
| FOLDER: ${{ secrets.FOLDER }} | |
| DOMAIN: ${{ secrets.DOMAIN }} | |
| PUBLIC_SSH_KEY: ${{ secrets.PUBLIC_SSH_KEY }} | |
| BUCKET: ${{ secrets.BUCKET }} | |
| ACCESS_KEY: ${{ secrets.ACCESS_KEY }} | |
| SECRET_KEY: ${{ secrets.SECRET_KEY }} |