- add build job that runs `make plan` - add deploy job that runs `make apply` - ensure make-plan also runs init target - enable provider caching - enable creating client.crt/client.key - trap EXIT to cleanup temp directory
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: almalinux-8
|
||||
container:
|
||||
image: git.unkin.net/unkin/almalinux9-actionsdind:latest
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Fetch master branch
|
||||
run: |
|
||||
git fetch origin master:master
|
||||
|
||||
- name: Show changed files
|
||||
run: |
|
||||
git diff --name-only master
|
||||
|
||||
- name: Run Terraform Plan
|
||||
env:
|
||||
VAULT_ROLEID: ${{ secrets.TERRAFORM_INCUS_VAULT_ROLEID }}
|
||||
run: |
|
||||
make plan
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: almalinux-8
|
||||
container:
|
||||
image: git.unkin.net/unkin/almalinux9-actionsdind:latest
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Fetch master branch
|
||||
run: |
|
||||
git fetch origin master:master
|
||||
|
||||
- name: Show changed files
|
||||
run: |
|
||||
git diff --name-only master
|
||||
|
||||
- name: Run Terraform Apply
|
||||
env:
|
||||
VAULT_ROLEID: ${{ secrets.TERRAFORM_INCUS_VAULT_ROLEID }}
|
||||
run: |
|
||||
make apply
|
||||
Reference in New Issue
Block a user