-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 1.72 KB
/
cicd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: CI/CD
on:
pull_request: { branches: ["*"] }
push:
branches:
- "+([0-9])?(.{+([0-9]),x}).x"
- main
- next
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: "17"
- uses: hashicorp/setup-terraform@v1
with:
terraform_version: "1.6.5"
- uses: actions/cache@v2
with:
path: .terraform/
key: ${{ hashFiles('.terraform.lock.hcl') }}
- uses: actions/cache@v2
with:
path: build/
key: ${{ github.sha }}
- run: terraform init
- run: terraform fmt -check
- run: terraform validate -no-color
- run: mkdir -p build
- run: cp -R .terraform.lock.hcl *.tf build
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo CodeCoverage
release:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: build/
key: ${{ github.sha }}
- run: cp .github/.releaserc.yml .
- run: npm i -g semantic-release @semantic-release/changelog @semantic-release/github @semantic-release/git
- run: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}