-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (45 loc) · 1.24 KB
/
ci.yaml
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
name: ci
on:
push:
jobs:
run:
runs-on: ubuntu-latest
steps:
# Prepare
- name: Checkout
uses: actions/checkout@v4
- name: Setup Humanitec CLI
uses: humanitec/setup-cli-action@v1
with:
version: "0.21.1"
- name: Setup tflit
uses: terraform-linters/setup-tflint@v4
with:
tflint_version: v0.49.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Validate
- name: Lint
run: make lint
- name: Simulate a humctl login
run: |
yq e -n '.token = "'"${HUMANITEC_TOKEN}"'"' > ~/.humctl
env:
HUMANITEC_TOKEN: ${{ secrets.HUMANITEC_TOKEN }}
- name: Test
run: make test
env:
HUMANITEC_ORG: ${{ secrets.HUMANITEC_ORG }}
# Push
- if: github.ref == 'refs/heads/main'
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- if: github.ref == 'refs/heads/main'
name: Push image
run: make push