Production: ghcr.io/piny940/portfolio-updater:1.0.27 #237
Workflow file for this run
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
name: CI | |
on: | |
push: | |
permissions: | |
id-token: write | |
contents: read | |
pull-requests: read | |
jobs: | |
filter: | |
runs-on: ubuntu-latest | |
outputs: | |
kube: ${{ steps.path-filter.outputs.kube }} | |
gcp: ${{ steps.path-filter.outputs.gcp }} | |
aws: ${{ steps.path-filter.outputs.aws }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/bot-filter | |
id: bot-filter | |
with: | |
actor: ${{ github.actor }} | |
- uses: dorny/paths-filter@v3 | |
if: steps.bot-filter.outputs.is-bot == 'false' || ${{ github.ref_name }} == 'main' | |
id: path-filter | |
with: | |
filters: | | |
kube: | |
- "kubernetes/**" | |
- ".github/workflows/ci.yaml" | |
gcp: | |
- "gcp/**" | |
- ".github/workflows/ci.yaml" | |
aws: | |
- "aws/**" | |
- ".github/workflows/ci.yaml" | |
# kubeconform: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: yokawasa/[email protected] | |
# with: | |
# setup-tools: | | |
# kubeconform | |
# kustomize | |
# kubeconform: "0.6.6" | |
# kustomize: "5.4.1" | |
# - run: | | |
# for APP in $(ls kubernetes/apps/) | |
# do | |
# kustomize build kubernetes/apps/$APP | | |
# kubeconform -summary \ | |
# -schema-location default \ | |
# -schema-location 'https://raw.githubusercontent.com/piny940/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \ | |
# -output json | |
# done | |
kube-yamlfmt: | |
runs-on: ubuntu-latest | |
needs: filter | |
if: needs.filter.outputs.kube == 'true' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "^1.22.1" | |
- name: Install yamlfmt | |
run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest | |
- name: Yamlfmt | |
run: yamlfmt -lint kubernetes/ | |
kube-flux: | |
runs-on: ubuntu-latest | |
needs: filter | |
if: needs.filter.outputs.kube == 'true' | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
cd kubernetes/ | |
before=$(ls _flux/**/*) | |
bash scripts/flux-kustomize.sh | |
after=$(ls _flux/**/*) | |
diff=$(diff <(echo ${before}) <(echo ${after})) | |
if [ -z "$diff" ]; then | |
echo "No changes detected" | |
exit 0 | |
else | |
echo "Changes detected" | |
exit 1 | |
fi | |
tf-format: | |
runs-on: ubuntu-latest | |
needs: filter | |
if: needs.filter.outputs.aws == 'true' || needs.filter.outputs.gcp == 'true' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: 1.9.5 | |
- name: Terraform fmt | |
run: terraform fmt -check -recursive |