Files
firezone/.github/workflows/cd.yml
dependabot[bot] ed8a74e642 Bump hashicorp/tfc-workflows-github from 1.0.0 to 1.0.2 (#1780)
Bumps
[hashicorp/tfc-workflows-github](https://github.com/hashicorp/tfc-workflows-github)
from 1.0.0 to 1.0.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/hashicorp/tfc-workflows-github/releases">hashicorp/tfc-workflows-github's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.2</h2>
<p>Bug fixes from <a
href="https://github.com/hashicorp/tfc-workflows-tooling/releases/tag/v1.0.2">tfc-workflows-tooling@v1.0.2</a>
version bump.</p>
<h2>v1.0.1</h2>
<p>Bug fixes and enhancements from <a
href="https://github.com/hashicorp/tfc-workflows-tooling/releases/tag/v1.0.1">tfc-workflows-tooling@v1.0.1</a>
version bump</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/hashicorp/tfc-workflows-github/blob/main/CHANGELOG.md">hashicorp/tfc-workflows-github's
changelog</a>.</em></p>
<blockquote>
<h1>v1.0.2</h1>
<ul>
<li>Bug fixes and enhancements from <a
href="https://github.com/hashicorp/tfc-workflows-tooling/releases/tag/v1.0.2">tfc-workflows-tooling@v1.0.2</a>
version bump</li>
</ul>
<h1>v1.0.1</h1>
<ul>
<li>Bug fixes and enhancements from <a
href="https://github.com/hashicorp/tfc-workflows-tooling/releases/tag/v1.0.1">tfc-workflows-tooling@v1.0.1</a>
version bump</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="02ae73d5f2"><code>02ae73d</code></a>
Prepare for v1.0.2 (<a
href="https://redirect.github.com/hashicorp/tfc-workflows-github/issues/11">#11</a>)</li>
<li><a
href="c198b4e6a2"><code>c198b4e</code></a>
Prepare v1.0.1 release (<a
href="https://redirect.github.com/hashicorp/tfc-workflows-github/issues/8">#8</a>)</li>
<li><a
href="c18b3c5402"><code>c18b3c5</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/tfc-workflows-github/issues/6">#6</a>
from raisedadead/fix/comment-in-actions</li>
<li><a
href="e79c9911cd"><code>e79c991</code></a>
fix(workflows): adjust the PR comment for formatting</li>
<li><a
href="90c7396325"><code>90c7396</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/tfc-workflows-github/issues/4">#4</a>
from juicybaba/main</li>
<li><a
href="1179034dd0"><code>1179034</code></a>
fix: update use to uses</li>
<li><a
href="e3eae1bb99"><code>e3eae1b</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/tfc-workflows-github/issues/3">#3</a>
from hashicorp/mjyocca/add-pr-template</li>
<li><a
href="e0a9002100"><code>e0a9002</code></a>
add pull request template</li>
<li><a
href="71bf0a0e30"><code>71bf0a0</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/tfc-workflows-github/issues/2">#2</a>
from hashicorp/mjyocca/add-change-log-cleanup</li>
<li><a
href="e9851adbf1"><code>e9851ad</code></a>
fix descriptions and add links to docs</li>
<li>Additional commits viewable in <a
href="https://github.com/hashicorp/tfc-workflows-github/compare/v1.0.0...v1.0.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=hashicorp/tfc-workflows-github&package-manager=github_actions&previous-version=1.0.0&new-version=1.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-15 17:30:51 +00:00

102 lines
3.9 KiB
YAML

name: Continuous Delivery
on:
push:
branches:
- main
# Cancel old workflow runs if new code is pushed
concurrency:
group: "cd-${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: false
jobs:
elixir:
uses: ./.github/workflows/elixir.yml
rust:
uses: ./.github/workflows/rust.yml
terraform:
uses: ./.github/workflows/terraform.yml
secrets: inherit
deploy:
runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
needs:
- elixir
- rust
- terraform
env:
TF_CLOUD_ORGANIZATION: "firezone"
TF_API_TOKEN: "${{ secrets.TF_API_TOKEN }}"
TF_WORKSPACE: "staging"
steps:
- name: Get Terraform Version
run: |
TERRAFORM_VERSION=$(cat .tool-versions | grep terraform | awk '{ print $NF; }')
echo "TERRAFORM_VERSION=${TERRAFORM_VERSION}" >> $GITHUB_ENV
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_branch }}
# - name: "Push Changed Application Tags"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# FILE_TO_COMMIT: terraform/environments/staging/versions.auto.tfvars
# DESTINATION_BRANCH: ${{ github.ref_name }}
# run: |
# sed -ri 's/^(\s*)(api_image_tag\s*=\s*"[^"]*"\s*$)/api_image_tag = "${{ github.sha }}"/' ./terraform/environments/staging/versions.auto.tfvars
# sed -ri 's/^(\s*)(web_image_tag\s*=\s*"[^"]*"\s*$)/web_image_tag = "${{ github.sha }}"/' ./terraform/environments/staging/versions.auto.tfvars
# cat ./terraform/environments/staging/versions.auto.tfvars
# export TODAY=$( date -u '+%Y-%m-%d' )
# export SHA=$( git rev-parse $DESTINATION_BRANCH:$FILE_TO_COMMIT )
# export CONTENT=$( base64 -i $FILE_TO_COMMIT )
# gh api \
# --method PUT /repos/${{ github.repository }}/contents/$FILE_TO_COMMIT \
# --field message="Push updated container versions [skip actions]" \
# --field content="$CONTENT" \
# --field encoding="base64" \
# --field branch="$DESTINATION_BRANCH" \
# --field sha="$SHA"
- name: Upload Configuration
uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.0.2
id: apply-upload
with:
workspace: ${{ env.TF_WORKSPACE }}
# Subdirectory is set in the project settings:
# https://app.terraform.io/app/firezone/workspaces/staging/settings/general
directory: "./"
- name: Create Plan Run
uses: hashicorp/tfc-workflows-github/actions/create-run@v1.0.2
id: apply-run
env:
TF_VAR_api_image_tag: '"${{ github.sha }}"'
TF_VAR_web_image_tag: '"${{ github.sha }}"'
with:
workspace: ${{ env.TF_WORKSPACE }}
configuration_version: ${{ steps.apply-upload.outputs.configuration_version_id }}
- name: Apply
uses: hashicorp/tfc-workflows-github/actions/apply-run@v1.0.2
if: fromJSON(steps.apply-run.outputs.payload).data.attributes.actions.IsConfirmable
id: apply
with:
run: ${{ steps.apply-run.outputs.run_id }}
comment: "Apply Run from GitHub Actions CI ${{ github.sha }}"
- name: Report Status
if: failure()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_USERNAME: "GitHub Actions"
SLACK_COLOR: "#ff0000"
MSG_MINIMAL: "ref,actions url"
SLACK_TITLE: "Deployment Failed"
SLACK_MESSAGE: "Automatic deployment to ${{ env.TF_WORKSPACE }} failed"
with:
status: ${{ job.status }}
notify_when: "failure"