Skip to content

Commit

Permalink
👷 build & publish container image on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
davidB committed Jan 3, 2024
1 parent fe2f8b5 commit 6c17a3f
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: release

on:
# push:
# branches:
# - main
workflow_dispatch:

permissions:
contents: read
packages: write
# id-token: write

jobs:
push-store-image:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v4
with:
fetch-depth: "0" # to be able to use `git describe` and retrieve tags

- name: "Login to GitHub Container Registry"
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

# - name: "Build Inventory Image"
# run: |
# docker build . --tag ghcr.io/<your-GitHub-username>/store:latest
# docker push ghcr.io/${{ github.repository }}/store:latest

- name: Run Skaffold pipeline as action
uses: hiberbee/[email protected]
with:
skaffold-version: "2.9.0"
command: build
# repository: ghcr.io/${{ github.repository }}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ HEALTHCHECK NONE
# checkov:skip=CKV_DOCKER_7:Ensure the base image uses a non latest version tag
# trivy:ignore:AVD-DS-0001
FROM cgr.dev/chainguard/glibc-dynamic as cdviz-collector
LABEL org.opencontainers.image.source="https://github.com/davidB/cdviz"
ARG PROFILE=release
USER nonroot
COPY --from=build /work/target/${PROFILE}/cdviz-collector /usr/local/bin/cdviz-collector
Expand All @@ -39,6 +40,7 @@ HEALTHCHECK NONE
# checkov:skip=CKV_DOCKER_7:Ensure the base image uses a non latest version tag
# trivy:ignore:AVD-DS-0001
FROM cgr.dev/chainguard/glibc-dynamic AS cdviz-dbmigration
LABEL org.opencontainers.image.source="https://github.com/davidB/cdviz"
USER nonroot
COPY --from=build-sqlx /home/nonroot/.cargo/bin/sqlx /usr/local/bin/sqlx
COPY migrations /migrations
Expand Down
4 changes: 2 additions & 2 deletions charts/cdviz-collector/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: cdviz-collector
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: "0.1.0"
version: 0.1.0 # TODO Change this to a version number on release
appVersion: "0.1.0" # TODO Change this to a version number on release

dependencies:
- name: postgresql
Expand Down
4 changes: 2 additions & 2 deletions charts/cdviz-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ image:
repository: ghcr.io/davidb/cdviz-collector
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
tag: "latest" # TODO Change this to a version number on release

imagePullSecrets: []
nameOverride: ""
Expand Down Expand Up @@ -90,7 +90,7 @@ dbMigration:
image:
repository: ghcr.io/davidb/cdviz-dbmigration
pullPolicy: IfNotPresent
tag: ""
tag: "latest" # TODO Change this to a version number on release

Check failure on line 93 in charts/cdviz-collector/values.yaml

View workflow job for this annotation

GitHub Actions / MegaLinter

93:10 syntax error: mapping values are not allowed here (syntax)
annotations:
{}
# "helm.sh/hook": post-install,post-upgrade
Expand Down

0 comments on commit 6c17a3f

Please sign in to comment.