cat to objects #1643
This file contains 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
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
schedule: | |
- cron: "0 5 * * *" | |
workflow_dispatch: | |
env: | |
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }} | |
PIHOLE_PASSWORD: ${{ secrets.PIHOLE_PASSWORD }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
HARNESS_ACCOUNT_ID: "-N_5zBuvRm2gzVAaNZ64lQ" | |
HARNESS_PLATFORM_API_KEY: ${{ secrets.HARNESS_PLATFORM_API_KEY }} | |
jobs: | |
tofu: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: opentofu/setup-opentofu@v1 | |
- working-directory: infra/ | |
run: tofu fmt -check | |
- working-directory: infra/ | |
run: tofu init | |
- working-directory: infra/ | |
run: tofu validate -no-color | |
- id: plan | |
if: github.event_name == 'pull_request' | |
working-directory: infra/ | |
run: tofu plan -no-color | |
continue-on-error: true | |
- uses: actions/[email protected] | |
if: github.event_name == 'pull_request' | |
env: | |
PLAN: "tofu\n${{ steps.plan.outputs.stdout }}" | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const output = `#### tofu Format and Style 🖌\`${{ steps.fmt.outcome }}\` | |
#### tofu Initialization ⚙️\`${{ steps.init.outcome }}\` | |
#### tofu Validation 🤖\`${{ steps.validate.outcome }}\` | |
#### tofu Plan 📖\`${{ steps.plan.outcome }}\` | |
<details><summary>Show Plan</summary> | |
\`\`\`\n | |
${process.env.PLAN} | |
\`\`\` | |
</details> | |
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`; | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: output | |
}) | |
- name: tofu Plan Status | |
if: steps.plan.outcome == 'failure' | |
working-directory: infra/ | |
run: exit 1 | |
- name: tofu Apply | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
working-directory: infra/ | |
run: tofu apply -auto-approve |