Skip to content

feat: add CI-driven image tag updates, remove Image Updater #4

feat: add CI-driven image tag updates, remove Image Updater

feat: add CI-driven image tag updates, remove Image Updater #4

Workflow file for this run

---
name: Build & Push Images
on:
push:
branches: ["**"]
paths-ignore:
- "k8s/**"
- "**.md"
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
REGISTRY: ${{ vars.REGISTRY || 'registry.wdr.io' }}
REPO: ${{ github.event.repository.name }}
jobs:
# ---------------------------------------------------------------
# Stage 1: Validate codebase.
# Simple project has no application code to lint — just verify
# the Dockerfile and static content are well-formed.
# ---------------------------------------------------------------
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: silta/nginx.Dockerfile
failure-threshold: error
# ---------------------------------------------------------------
# Stage 2: Build and push Docker image.
# ---------------------------------------------------------------
build-image:
name: Build & Push — nginx
runs-on: ubuntu-latest
needs: validate
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build & push image
uses: wunderio/silta-actions/build-push-image@v1
with:
image-name: nginx
dockerfile: silta/nginx.Dockerfile
registry: ${{ env.REGISTRY }}
registry-username: ${{ secrets.REGISTRY_USERNAME }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
# ---------------------------------------------------------------
# Stage 3: Update image tags in ArgoCD values files.
# Queries the registry for the latest tags and commits the update.
# ---------------------------------------------------------------
update-tags:
name: Update Image Tags
runs-on: ubuntu-latest
needs: build-image
permissions:
contents: write
steps:
- name: Update image tags
uses: wunderio/silta-actions/update-image-tags@v1
with:
image-names: nginx
values-file: values/simple.yaml
registry: ${{ env.REGISTRY }}
registry-username: ${{ secrets.REGISTRY_USERNAME }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}