Skip to content

Commit

Permalink
ci: Do not deploy application
Browse files Browse the repository at this point in the history
  • Loading branch information
nileger committed Jul 17, 2024
1 parent 1a91ffa commit 2f6722f
Showing 1 changed file with 66 additions and 66 deletions.
132 changes: 66 additions & 66 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.10.5'
python-version: "3.10.5"
- name: Install packages
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-depth: 0
- uses: hadolint/[email protected]
# Build and Push the Docker Image
docker:
Expand Down Expand Up @@ -103,70 +103,70 @@ jobs:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: mikepenz/release-changelog-builder-action@v3
id: build_changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ncipollo/release-action@v1
with:
commit: main
body: ${{ steps.build_changelog.outputs.changelog }}
tag: ${{ needs.generate-semantic-version.outputs.next-version }}
token: ${{ secrets.GITHUB_TOKEN }}
# Lint the Terraform Code and Deploy the Application via Terraform Cloud
terraform:
needs: [release, tfsec, generate-semantic-version, docker]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
- uses: actions/checkout@v2
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform Format
id: fmt
run: terraform fmt -check
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Validate
id: validate
run: terraform validate -no-color
- name: Terraform Plan
id: plan
if: github.event_name == 'pull_request'
run: terraform plan -no-color -input=false -var image_tag=${{ needs.generate-semantic-version.outputs.next-version }}
continue-on-error: true
- uses: actions/github-script@v6
if: github.event_name == 'pull_request'
fetch-depth: 0
- uses: mikepenz/release-changelog-builder-action@v3
id: build_changelog
env:
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ncipollo/release-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const output = `#### Terraform Format and Style πŸ–Œ\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization βš™οΈ\`${{ steps.init.outcome }}\`
#### Terraform Validation πŸ€–\`${{ steps.validate.outcome }}\`
#### Terraform Plan πŸ“–\`${{ steps.plan.outcome }}\`
<details><summary>Show Plan</summary>
\`\`\`\n
${process.env.PLAN}
\`\`\`
</details>
*Pushed by: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1
- name: Terraform Apply
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: terraform apply -auto-approve -input=false -var image_tag=${{ needs.generate-semantic-version.outputs.next-version }}
commit: main
body: ${{ steps.build_changelog.outputs.changelog }}
tag: ${{ needs.generate-semantic-version.outputs.next-version }}
token: ${{ secrets.GITHUB_TOKEN }}
# Lint the Terraform Code and Deploy the Application via Terraform Cloud
# terraform:
# needs: [release, tfsec, generate-semantic-version, docker]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Setup Terraform
# uses: hashicorp/setup-terraform@v1
# with:
# cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
# - name: Terraform Format
# id: fmt
# run: terraform fmt -check
# - name: Terraform Init
# id: init
# run: terraform init
# - name: Terraform Validate
# id: validate
# run: terraform validate -no-color
# - name: Terraform Plan
# id: plan
# if: github.event_name == 'pull_request'
# run: terraform plan -no-color -input=false -var image_tag=${{ needs.generate-semantic-version.outputs.next-version }}
# continue-on-error: true
# - uses: actions/github-script@v6
# if: github.event_name == 'pull_request'
# env:
# PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# script: |
# const output = `#### Terraform Format and Style πŸ–Œ\`${{ steps.fmt.outcome }}\`
# #### Terraform Initialization βš™οΈ\`${{ steps.init.outcome }}\`
# #### Terraform Validation πŸ€–\`${{ steps.validate.outcome }}\`
# #### Terraform Plan πŸ“–\`${{ steps.plan.outcome }}\`
# <details><summary>Show Plan</summary>
# \`\`\`\n
# ${process.env.PLAN}
# \`\`\`
# </details>
# *Pushed by: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: output
# })
# - name: Terraform Plan Status
# if: steps.plan.outcome == 'failure'
# run: exit 1
# - name: Terraform Apply
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'
# run: terraform apply -auto-approve -input=false -var image_tag=${{ needs.generate-semantic-version.outputs.next-version }}

0 comments on commit 2f6722f

Please sign in to comment.