Compare commits

...

67 Commits
v1 ... main

Author SHA1 Message Date
Amit Rajput
2aee68df73 s3 workflow with gcp 2025-11-27 15:57:13 +05:30
Amit Rajput
2490ff12db force 2025-11-27 15:49:42 +05:30
Amit Rajput
e5a928d13d Separate build for GCP 2025-11-27 15:44:46 +05:30
Amit Rajput
c9ce6e5f2b changing secret to vars 2025-11-27 15:38:56 +05:30
Amit Rajput
41fdf1fa9b separating out build for gcp and repo 2025-11-27 15:23:15 +05:30
Amit Rajput
a6fbab9110 GCP workflow 2025-11-27 15:09:36 +05:30
Sahil Ahuja
9db021b9fa template 2025-03-08 04:11:53 +05:30
Sahil Ahuja
427ec7d0db Removing templates 2025-03-08 03:49:35 +05:30
Sahil Ahuja
bd24e8ffa0 Making docker scripts more robust 2025-03-08 03:26:22 +05:30
Sahil Ahuja
efbb720adf Updating template 2025-03-06 23:41:25 +05:30
Sahil Ahuja
91845516ad Adding fail on scan 2025-03-04 15:15:06 +05:30
Sahil Ahuja
16f8a4f21f Fixing types 2025-03-03 15:42:34 +05:30
Sahil Ahuja
0ed6aa1276 Fixing type 2025-03-03 15:31:35 +05:30
Sahil Ahuja
926a9f858f Callers 2025-03-03 15:19:59 +05:30
Sahil Ahuja
54e7a01dfd More base commands 2025-02-22 01:42:16 +05:30
Sahil Ahuja
c09b4b860a Organizing READMEs 2025-02-21 12:40:30 +05:30
Sahil Ahuja
c1c97a4d3e Fixing order of installs in npm build 2025-02-21 01:26:55 +05:30
Sahil Ahuja
fca761eb60 Updating eslint config 2025-02-18 22:58:57 +05:30
Sahil Ahuja
79718eb5d3 Build status 2025-02-18 17:45:03 +05:30
Sahil Ahuja
eac11e3221 New baseimage job 2025-02-17 16:56:33 +05:30
Sahil Ahuja
554f9b8b3b New location of tsconfigs 2025-02-17 12:09:27 +05:30
Sahil Ahuja
4b19b20335 Comments 2025-02-17 12:06:13 +05:30
Sahil Ahuja
e456dc24af Comments 2025-02-17 12:06:02 +05:30
Sahil Ahuja
61766a3e9a Documentation 2025-02-17 12:04:54 +05:30
Sahil Ahuja
46f7d871e0 Comments 2025-02-17 12:01:05 +05:30
Sahil Ahuja
fae8e2391a Typo 2025-02-17 11:59:45 +05:30
Sahil Ahuja
ee18665ef6 Gitignore 2025-02-17 11:49:33 +05:30
Sahil Ahuja
271501cafb Changes 2025-02-17 11:48:05 +05:30
Sahil Ahuja
4e1628177d New base images, slim for prod, dev for devs 2025-02-16 22:38:30 +05:30
Sahil Ahuja
f12ff2d395 Typo 2025-02-16 22:30:51 +05:30
Sahil Ahuja
88ed99b7fc Adding vitest to repo templates 2025-02-16 22:21:04 +05:30
Sahil Ahuja
51d86ab31b Adding package.json to template 2025-02-16 22:11:40 +05:30
Sahil Ahuja
43849834d3 Updating constants 2025-02-16 21:53:11 +05:30
Sahil Ahuja
158704ce57 Making template usable 2025-02-16 21:51:36 +05:30
Sahil Ahuja
4d2248a6b3 Formatting 2025-02-16 21:46:20 +05:30
Sahil Ahuja
83e5e27434 Add code test 2025-02-16 21:11:30 +05:30
Sahil Ahuja
a4eb3de63a Templates, adding code scan step 2025-02-16 21:07:17 +05:30
Sahil Ahuja
81c7700e22 Organizing repo templates 2025-02-16 20:56:23 +05:30
Sahil Ahuja
5225763586 New code scan action 2025-02-15 17:52:10 +05:30
Sahil Ahuja
e76de4495e Latest changes 2025-02-15 17:47:53 +05:30
Sahil Ahuja
79c2498e4a Updating template 2025-02-14 00:39:16 +05:30
Sahil Ahuja
4587a3f7c4 Comments 2025-02-13 23:45:39 +05:30
Sahil Ahuja
7779ba8e29 New cs-update trigger 2025-02-13 23:43:15 +05:30
Sahil Ahuja
beb40ea877 comments 2025-02-13 22:30:31 +05:30
Sahil Ahuja
90260b0efa Comments 2025-02-13 22:17:18 +05:30
Sahil Ahuja
f6eb8b6315 Comments 2025-02-13 22:05:29 +05:30
Sahil Ahuja
bfe846c9b2 Adding template for docker 2025-02-13 20:26:29 +05:30
Sahil Ahuja
1fbd64e412 Documentation 2025-02-13 17:38:38 +05:30
Sahil Ahuja
60d2d0c243 Changes 2025-02-13 17:24:09 +05:30
Sahil Ahuja
21967e6a8b Docs 2025-02-13 13:04:06 +05:30
Sahil Ahuja
21bab00845 Changes 2025-02-13 13:02:17 +05:30
Sahil Ahuja
43623ff9fa Documentation 2025-02-13 13:00:02 +05:30
Sahil Ahuja
0316d2ecc0 Comments 2025-02-13 12:52:01 +05:30
Sahil Ahuja
014680f18e New #minor update 2025-02-13 12:50:46 +05:30
Sahil Ahuja
7a2e073e16 New new 2025-02-13 12:50:24 +05:30
Sahil Ahuja
f90d55af8a new builds 2025-02-13 12:48:35 +05:30
Sahil Ahuja
14fab87017 Push base image to test 2025-02-10 21:03:43 +05:30
Sahil Ahuja
ade5e88991 Adding base image builder 2025-02-10 20:50:40 +05:30
Sahil Ahuja
db8950fa34 Unused 2025-02-05 19:39:47 +05:30
Sahil Ahuja
f280a99559 Update 2025-02-05 19:38:45 +05:30
Sahil Ahuja
cd28dd385b Updating basetag 2025-02-05 19:21:17 +05:30
Sahil Ahuja
5d3a8536f3 Comments 2025-02-04 17:31:18 +05:30
Sahil Ahuja
0b3f4afd4d Fix typo 2025-02-04 16:02:37 +05:30
Sahil Ahuja
b320bbd05c Fixes 2025-02-04 15:57:46 +05:30
Sahil Ahuja
ea714bbb9e Fixing image name 2025-02-04 15:54:33 +05:30
Sahil Ahuja
d75532dd10 Adding deploy-cs job 2025-02-04 15:25:20 +05:30
Sahil Ahuja
9560cd7fe6 Renaming to build tools 2025-01-31 13:09:18 +05:30
28 changed files with 1189 additions and 35 deletions

43
.github/unused/actions-base.Dockerfile vendored Normal file
View File

@ -0,0 +1,43 @@
FROM node:22-bookworm-slim
#Use an entrypoint that simply lists out all commands sent to it
COPY entryPoint.sh /src/fab/entryPoint.sh
ENTRYPOINT ["/src/fab/entryPoint.sh"]
#node:18 image already has a user node with uid:gid 1000:1000
#We add it to sudo list
RUN export DEBIAN_FRONTEND="noninteractive" \
&& apt-get update \
&& apt-get install -y \
# sudo \
less \
#Neededd for git commits during builds
# git \
#Needed for triggering next step of builds
# curl \
&& rm -rf /var/lib/apt/lists/* \
# && usermod -aG sudo node \
# && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
#Creating a few base folders that child dockers may need
&& mkdir -p /src && chown node /src \
&& mkdir -p /cloud && chown node /cloud \
&& mkdir -p /build && chown node /build \
# && npm install -g npm@10.8.2 \
&& npm install -g pnpm
USER node
# upgrade pnpm to latest version
#&& source ~/.bashrc \ #doesn't work
#Also, "pnpm add -g pnpm" needs be in "~" to work - it doesn't work from "/" dir (not sure why).
RUN SHELL=bash pnpm setup \
&& export PNPM_HOME="~/.local/share/pnpm" && export PATH="$PNPM_HOME:$PATH" \
&& cd ~ && pnpm add -g pnpm
RUN echo '\nalias p="pnpm"' >> ~/.bashrc
WORKDIR /src
#Allow image to be used standalone without any commands:
CMD ["tail", "-f", "/dev/null"]
#CMD ["sleep", "inf"]

43
.github/unused/build-base-image.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: Build the docker base image weekly
# on: [push]
on:
push:
# branches:
# - main
schedule:
- cron: "0 6 * * 5" #Every Friday@11:30 AM IST (6:00 GMT)
# Cron: Minute(0-59) Hour(0-23) DayOfMonth(1-31) MonthOfYear(1-12) DayOfWeek(0-6)
env:
DOCKER_REGISTRY: ${{ vars.docker_repo2_registry }}
REPO: ${{ github.repository }}
DOCKER_IMAGE: ${{ vars.docker_repo2_registry }}/${{ github.repository }}:base-v2
jobs:
docker-build-and-push:
runs-on: ubuntu-22.04 #ubuntu-latest
# if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v4
- name: Login to Docker Container Registry
# if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
registry: ${{ vars.docker_repo2_registry }}
username: ${{ vars.docker_repo2_username }}
password: ${{ vars.docker_repo2_password }}
- name: Build the Base Docker image
run: |
docker build \
--file fab/d/actions-base.Dockerfile \
--tag $DOCKER_IMAGE \
./fab/context/;
- name: Push the Docker image
# if: ${{ github.event_name == 'push' }}
run: |
docker push $DOCKER_IMAGE

32
.github/unused/demo.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Gitea Actions Demo
run-name: ${{ github.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
echo "var.DOCKER_REPO2_REGISTRY" repo2.hub.gmetri.io
echo "github.repository" ${{ github.repository }}
echo "github.ref_name" ${{ github.ref_name }}
- run: echo "🍏 This job's status is ${{ job.status }}."
# Gitea action runners
# - "ubuntu-latest:docker://repo2.hub.gmetri.io/gitea/runner-images:ubuntu-latest"
# - "ubuntu-22.04:docker://repo2.hub.gmetri.io/gitea/runner-images:ubuntu-22.04"
# - "ubuntu-20.04:docker://repo2.hub.gmetri.io/gitea/runner-images:ubuntu-20.04"
# - "ubuntu-latest-slim:docker://repo2.hub.gmetri.io/gitea/runner-images:ubuntu-latest-slim"
# - "ubuntu-22.04-slim:docker://repo2.hub.gmetri.io/gitea/runner-images:ubuntu-22.04-slim"
# - "ubuntu-20.04-slim:docker://repo2.hub.gmetri.io/gitea/runner-images:ubuntu-20.04-slim"

91
.github/unused/docker-publish.yml vendored Normal file
View File

@ -0,0 +1,91 @@
name: Docker
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
schedule:
- cron: $cron-daily
push:
branches: [ $default-branch ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ $default-branch ]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ${{ vars.docker_repo2_registry }}
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
with:
cosign-release: 'v2.2.4'
# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.docker_repo2_username }}
password: ${{ secrets.docker_repo2_password }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

54
.github/unused/docker-push.yml vendored Normal file
View File

@ -0,0 +1,54 @@
name: Docker Image CI
on: [push]
# on:
# push:
# branches: [ $default-branch ]
# pull_request:
# branches: [ $default-branch ]
env:
IMAGE_NAME: repo2.hub.gmetri.io/${{ github.repository }}:${{ github.ref_name }}-v9
jobs:
docker-build-and-push:
runs-on: ubuntu-22.04
steps:
- name: Debug
run: |
ls ${{ github.workspace }}
echo "VARS"
echo "vars.docker_repo2_username" ${{vars.docker_repo2_username}}
echo "SECRETS"
echo "secrets.docker_repo2_password2" ${{ secrets.docker_repo2_password2 }}
echo "CONTEXT"
echo "github.repository" ${{ github.repository }}
echo "github.ref_name" ${{ github.ref_name }}
- uses: docker/login-action@v3
name: Login to GitHub Container Registry
with:
registry: repo2.hub.gmetri.io
username: ${{ vars.docker_repo2_username }}
password: ${{ secrets.docker_repo2_password }}
- uses: actions/checkout@v4
- name: List files in the repository
run: |
ls ${{ github.workspace }} && \
echo "VARS"
echo "var.DOCKER_REPO2_REGISTRY" ${{ vars.DOCKER_REPO2_REGISTRY }}
echo "CONTEXT"
echo "github.repository" ${{ github.repository }}
echo "github.ref_name" ${{ github.ref_name }}
- name: Build the Docker image
run: |
docker build ./context --file context/Dockerfile --tag $IMAGE_NAME && \
docker push $IMAGE_NAME
# my-image-name:$(date +%s)
# ${DRONE_BRANCH//\//-}-v8

49
.github/unused/trigger-cs-job.yml vendored Normal file
View File

@ -0,0 +1,49 @@
name: Manually trigger a cs repo workflow
on:
workflow_dispatch:
inputs:
image:
type: choice
description: Image to deploy
options:
- repo2.hub.gmetri.io/dt-api
- repo2.hub.gmetri.io/gmetrivr/dt-api
tag:
description: Tag to deploy
required: true
type: string
env:
DEPLOY_REPO: gmetrivr/cs-dt
jobs:
trigger-cs-job:
runs-on: ubuntu-22.04
permissions:
issues: write
steps:
- name: run workflow from cs repo
run: |
echo "Inputs:: image:${{ inputs.image }} tag: ${{ inputs.tag }}";
echo "github.api_url: ${{ github.api_url }}";
ISSUE_COMMENT_STRING=`echo "{ \"image\": \"${{ inputs.image }}\", \"tag\": \"${{ inputs.tag }}\" }" | jq tostring`
echo ISSUE_COMMENT_STRING: $ISSUE_COMMENT_STRING
API_JSON_BODY=`echo '{"body": '$ISSUE_COMMENT_STRING' }' | jq -r tostring`
echo API_JSON_BODY: $API_JSON_BODY
# {"body":"{\"image\":\"repo2.hub.gmetri.io/dt-api\",\"tag\":\"main-255c2f30\"}"}
echo curl -X 'POST' \
'${{ github.api_url }}/repos/${{ env.DEPLOY_REPO }}/issues/1/comments' \
-H 'accept: application/json' \
-H 'Authorization: token ${{ secrets.bot_build_issues_token }}' \
-H 'Content-Type: application/json' \
-d $API_JSON_BODY
curl -X 'POST' \
'${{ github.api_url }}/repos/${{ env.DEPLOY_REPO }}/issues/1/comments' \
-H 'accept: application/json' \
-H 'Authorization: token ${{ secrets.bot_build_issues_token }}' \
-H 'Content-Type: application/json' \
-d $API_JSON_BODY

42
.github/unused/update-repo-version.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Update Repo Version Workflow
on:
workflow_call:
inputs:
branch:
description: "Branch getting released. (branch 'release' might update a different image)"
default: main
required: false
type: string
image:
description: "Name of the image"
required: true
type: string
tag:
description: "Tag of the image"
required: true
type: string
env:
REPO: ${{ github.repository }}
jobs:
npm-push:
runs-on: ubuntu-22.04
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
- name: Increment package version and push
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
pwd; ls -al;
echo ./drone/repo_to_cs.sh -m ${{ inputs.image }} -t ${{ inputs.tag }} -b ${{ inputs.branch }}
# git push origin main
# git push --tags origin main

149
.github/unused/v1-lint-and-build.yml vendored Normal file
View File

@ -0,0 +1,149 @@
name: Docker Image CI
# on: [push]
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
DOCKER_REGISTRY: ${{ vars.docker_repo2_registry }}
REPO: ${{ github.repository }}
jobs:
image-vulnerability-scan:
runs-on: ubuntu-22.04 #ubuntu-latest
steps:
- id: get-id
name: Get a unique tag for this build
run: |
SHA=${{github.sha}};
ID=${SHA:0:8};
echo "ID=$ID" >> "$GITHUB_OUTPUT";
echo "DOCKER_IMAGE=$DOCKER_REGISTRY/$REPO:temp-$ID" >> "$GITHUB_OUTPUT";
- name: Print build id and image name
run: |
echo "${{ steps.get-id.outputs.ID }}";
echo "${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- uses: actions/checkout@v4
- name: Login to Docker Container Registry
# if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
registry: ${{ vars.docker_repo2_registry }}
username: ${{ vars.docker_repo2_username }}
password: ${{ vars.docker_repo2_password }}
- name: Build the Docker image
# Commenting this from docker build for speed: --build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.ID }} \
run: |
docker build \
--file fab/d/actions-build.Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \
.;
- name: Scan Docker Image for vulnerabilities with Grype
uses: anchore/scan-action@v6
with:
image: ${{ steps.get-id.outputs.DOCKER_IMAGE }}
cache-db: true #Cache Grype DB in Github Actions
output-format: table
only-fixed: true
severity-cutoff: critical
fail-build: true
npm-push:
runs-on: ubuntu-22.04 #ubuntu-latest
if: ${{ github.event_name == 'push' }}
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: ${{ vars.NPM_REGISTRY }}
token: ${{ secrets.NPM_TOKEN }}
- name: Install NPM Dependencies
run: |
npm install -g pnpm
pnpm install
- name: Lint & Check
run: |
pnpm lint
pnpm check
- run: pnpm build
#If this is a merge of a pull request, GITHUB_BASE_REF will contain main.
#But if this is a direct commit on the main branch, then GITHUB_REF_NAME will contain main
- name: Increment package version and push
env:
GITHUB_TOKEN: ${{ github.token }}
# BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
run: |
git config --global user.name 'bot-build'
git config --global user.email 'techbots+build@gmetri.com'
export N=`node -p require\(\'./package.json\'\).name` && echo $N
pnpm version patch --message "v%s: $N [CI SKIP]"
git push origin
git push --tags origin
docker-build-and-push:
runs-on: ubuntu-22.04 #ubuntu-latest
# if: ${{ github.event_name == 'push' }}
steps:
- id: get-id
name: Get a unique tag for this build
run: |
SHA=${{github.sha}};
ID=${SHA:0:8};
echo "ID=$ID" >> "$GITHUB_OUTPUT";
echo "DOCKER_IMAGE=$DOCKER_REGISTRY/$REPO:$ID" >> "$GITHUB_OUTPUT";
- name: Print build id and image name
run: |
echo "${{ steps.get-id.outputs.ID }}";
echo "${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- uses: actions/checkout@v4
- name: Login to Docker Container Registry
# if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
registry: ${{ vars.docker_repo2_registry }}
username: ${{ vars.docker_repo2_username }}
password: ${{ vars.docker_repo2_password }}
- name: Build the Docker image
run: |
docker build \
--build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.ID }} \
--file fab/d/actions-build.Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \
.;
IMAGE_SIZE=`docker inspect -f "{{ .Size }}" ${{ steps.get-id.outputs.DOCKER_IMAGE }} | numfmt --to=si`;
echo "Image size $IMAGE_SIZE";
- name: Push the Docker image
if: ${{ github.event_name == 'push' }}
run: |
docker push ${{ steps.get-id.outputs.DOCKER_IMAGE }};
IMAGE_SIZE=`docker inspect -f "{{ .Size }}" ${{ steps.get-id.outputs.DOCKER_IMAGE }} | numfmt --to=si`;
echo "Pushed $IMAGE_SIZE image ${{ steps.get-id.outputs.DOCKER_IMAGE }}";

80
.github/unused/v2-pr-workflow.yml vendored Normal file
View File

@ -0,0 +1,80 @@
name: Docker Image CI
on:
pull_request:
branches:
- main
env:
REPO: ${{ github.repository }}/temp #Add /temp for PR workflow
jobs:
lint-and-compile:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: ${{ vars.NPM_REGISTRY }}
token: ${{ secrets.NPM_TOKEN }}
- name: Install npm dependencies
run: |
npm install -g pnpm
pnpm install
- run: pnpm lint
- run: pnpm check
image-vulnerability-scan:
runs-on: ubuntu-22.04
steps:
- id: get-id
name: Get a unique tag for this build
run: |
SHA=${{ github.sha }}; BRANCH_NAME=${{ github.base_ref || github.ref_name }};
BUILD_ID=$BRANCH_NAME-${SHA:0:8};
DOCKER_IMAGE=${{ vars.docker_repo2_registry }}/$REPO:$BUILD_ID;
echo "BUILD_ID=$BUILD_ID" >> "$GITHUB_OUTPUT";
echo "DOCKER_IMAGE=$DOCKER_IMAGE" >> "$GITHUB_OUTPUT";
- name: Print build id and image name
run: |
echo "BUILD_ID: ${{ steps.get-id.outputs.BUILD_ID }}";
echo "DOCKER_IMAGE: ${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- uses: actions/checkout@v4
- name: Login to docker container registry
uses: docker/login-action@v3
with:
registry: ${{ vars.docker_repo2_registry }}
username: ${{ vars.docker_repo2_username }}
password: ${{ vars.docker_repo2_password }}
- name: Build the container image (quick, without PUBLIC_BUILD_VERSION)
# Commenting this from docker build for speed: --build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.BUILD_ID }} \
run: |
docker build \
--file fab/d/actions-build.Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \
.;
- name: Container details
run: |
IMAGE_SIZE=`docker inspect -f "{{ .Size }}" ${{ steps.get-id.outputs.DOCKER_IMAGE }} | numfmt --to=si`;
echo "$IMAGE_SIZE container ${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- name: Scan container image for vulnerabilities with grype
uses: anchore/scan-action@v6
with:
image: ${{ steps.get-id.outputs.DOCKER_IMAGE }}
cache-db: true #Cache Grype DB in Github Actions
output-format: table
only-fixed: true
severity-cutoff: critical
fail-build: true

91
.github/unused/v2-push-workflow.yml vendored Normal file
View File

@ -0,0 +1,91 @@
name: Docker Image CI
on:
push:
branches:
- main
env:
REPO: ${{ github.repository }}
jobs:
npm-push:
runs-on: ubuntu-22.04
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: ${{ vars.NPM_REGISTRY }}
token: ${{ secrets.NPM_TOKEN }}
- name: Install npm dependencies
run: |
npm install -g pnpm
pnpm install
- run: pnpm build
- name: Increment package version and push
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
git config --global user.name 'bot-build'
git config --global user.email 'techbots+build@gmetri.com'
export N=`node -p require\(\'./package.json\'\).name` && echo $N
pnpm version patch --message "v%s: $N [CI SKIP]"
npm publish
git push origin
git push --tags origin
container-push:
runs-on: ubuntu-22.04
steps:
- id: get-id
name: Get a unique tag for this build
run: |
SHA=${{ github.sha }}; BRANCH_NAME=${{ github.base_ref || github.ref_name }};
BUILD_ID=$BRANCH_NAME-${SHA:0:8};
DOCKER_IMAGE=${{ vars.docker_repo2_registry }}/$REPO:$BUILD_ID;
echo "BUILD_ID=$BUILD_ID" >> "$GITHUB_OUTPUT";
echo "DOCKER_IMAGE=$DOCKER_IMAGE" >> "$GITHUB_OUTPUT";
- name: Print build id and image name
run: |
echo "BUILD_ID: ${{ steps.get-id.outputs.BUILD_ID }}";
echo "DOCKER_IMAGE: ${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- uses: actions/checkout@v4
- name: Login to docker container registry
uses: docker/login-action@v3
with:
registry: ${{ vars.docker_repo2_registry }}
username: ${{ vars.docker_repo2_username }}
password: ${{ vars.docker_repo2_password }}
- name: Build the container image
run: |
docker build \
--build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.BUILD_ID }} \
--file fab/d/actions-build.Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \
.;
- name: Container details
run: |
IMAGE_SIZE=`docker inspect -f "{{ .Size }}" ${{ steps.get-id.outputs.DOCKER_IMAGE }} | numfmt --to=si`;
echo "$IMAGE_SIZE container ${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- name: Push the container image
run: docker push ${{ steps.get-id.outputs.DOCKER_IMAGE }}

38
.github/unused/workflow_inputs.yml vendored Normal file
View File

@ -0,0 +1,38 @@
# Inputs with workflow_call (triggering from another workflow):
on:
workflow_call:
inputs:
username:
description: 'A username passed from the caller workflow'
default: 'john-doe'
required: false
type: string
jobs:
print-username:
runs-on: ubuntu-latest
steps:
- name: Print the input name to STDOUT
run: echo The username is ${{ inputs.username }}
# Inputs with workflow_dispatch (manual trigger):
name: Update Repo Version Workflow
on:
workflow_dispatch:
inputs:
name:
type: choice
description: Who to greet
options:
- monalisa
- cschleiden
message:
required: true
use-emoji:
type: boolean
description: Include 🎉🤣 emojis
environment:
type: environment

View File

@ -0,0 +1,71 @@
name: Build base images (Generally from basin repo)
on:
workflow_call:
inputs:
image_tag:
required: true
type: string
fail_on_scan:
default: true
type: boolean
jobs:
docker-build-and-push:
runs-on: ubuntu-22.04 #ubuntu-latest
steps:
- id: get-id
name: Get a unique tag for this build
run: |
echo "DOCKER_IMAGE=${{ vars.GCP_DOCKER_REGISTRY }}/${{ github.repository }}:${{ inputs.image_tag }}" >> "$GITHUB_OUTPUT";
- name: Print image name
run: |
echo "${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- uses: actions/checkout@v4
# ✅ 1) Auth to GCP (this is where your SA key is used)
- name: Auth to GCP
uses: google-github-actions/auth@v2
with:
# using your existing secret that contains the SA JSON
credentials_json: ${{ secrets.GCP_SA_KEY }}
# ✅ 2) Install gcloud (no creds here)
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ vars.GCP_PROJECT_ID }}
export_default_credentials: true
- name: Configure Docker for GAR
run: |
gcloud auth configure-docker ${{vars.GCP_REGION}}-docker.pkg.dev
- name: Build and push the Docker image
run: |
docker build \
--file context/Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \
./context;
- name: Container details
run: |
IMAGE_SIZE=`docker inspect -f "{{ .Size }}" ${{ steps.get-id.outputs.DOCKER_IMAGE }} | numfmt --to=si`;
echo "$IMAGE_SIZE container ${{ steps.get-id.outputs.DOCKER_IMAGE }}";
# - name: Scan Docker Image for vulnerabilities with Grype
# uses: anchore/scan-action@v6
# with:
# image: ${{ steps.get-id.outputs.DOCKER_IMAGE }}
# cache-db: true #Cache Grype DB in Github Actions
# output-format: table
# only-fixed: true
# severity-cutoff: critical
# fail-build: ${{ inputs.fail_on_scan }}
- name: Push the container image
run: docker push ${{ steps.get-id.outputs.DOCKER_IMAGE }}

View File

@ -6,6 +6,9 @@ on:
image_tag:
required: true
type: string
fail_on_scan:
default: true
type: boolean
jobs:
docker-build-and-push:
@ -52,7 +55,7 @@ jobs:
output-format: table
only-fixed: true
severity-cutoff: critical
fail-build: true
fail-build: ${{ inputs.fail_on_scan }}
- name: Push the container image
run: docker push ${{ steps.get-id.outputs.DOCKER_IMAGE }}

View File

@ -0,0 +1,59 @@
name: Build base images from code repos
on:
workflow_call:
inputs:
image_tag:
required: true
type: string
jobs:
docker-base-build-and-push:
runs-on: ubuntu-22.04 #ubuntu-latest
steps:
- id: get-id
name: Get a unique tag for this build
run: |
echo "DOCKER_IMAGE=${{ vars.docker_repo2_registry }}/${{ github.repository }}:${{ inputs.image_tag }}" >> "$GITHUB_OUTPUT";
- name: Print image name
run: |
echo "${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- uses: actions/checkout@v4
- name: Login to Docker Container Registry
# if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
registry: ${{ vars.docker_repo2_registry }}
username: ${{ secrets.docker_repo2_username }}
password: ${{ secrets.docker_repo2_password }}
- name: Build and push the Docker image
run: |
docker build \
--file fab/d/actions-base.Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \
.;
- name: Container details
run: |
IMAGE_SIZE=`docker inspect -f "{{ .Size }}" ${{ steps.get-id.outputs.DOCKER_IMAGE }} | numfmt --to=si`;
echo "$IMAGE_SIZE container ${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- name: Push the container image
run: docker push ${{ steps.get-id.outputs.DOCKER_IMAGE }}
- name: Scan Docker Image for vulnerabilities with Grype
uses: anchore/scan-action@v6
with:
image: ${{ steps.get-id.outputs.DOCKER_IMAGE }}
cache-db: true #Cache Grype DB in Github Actions
output-format: table
only-fixed: true
severity-cutoff: critical
fail-build: true

36
.github/workflows/push-code-scan.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Vulnerability Scan
# Secrets can only viewed in "push" events. Not pull_request events.
# That's why this step needs to be called on push, and not on pull_request (to read npm password).
on:
workflow_call:
jobs:
push-container-scan:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: ${{ vars.NPM_REGISTRY }}
token: ${{ secrets.NPM_TOKEN }}
- name: Install npm dependencies
run: |
npm install -g pnpm
pnpm install
- name: Scan container image for vulnerabilities with grype
uses: anchore/scan-action@v6
with:
path: "."
cache-db: true #Cache Grype DB in Github Actions
output-format: table
only-fixed: true
severity-cutoff: critical
fail-build: true

30
.github/workflows/push-code-test.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Run Tests
# Secrets can only viewed in "push" events. Not pull_request events.
# That's why this step needs to be called on push, and not on pull_request (to read npm password).
on:
workflow_call:
jobs:
push-container-scan:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: ${{ vars.NPM_REGISTRY }}
token: ${{ secrets.NPM_TOKEN }}
- name: Install npm dependencies
run: |
npm install -g pnpm
pnpm install
- name: Run Tests
run: |
pnpm test

View File

@ -0,0 +1,63 @@
name: Reusable container push workflow
on:
workflow_call:
env:
REPO: ${{ github.repository }}
jobs:
push-container:
runs-on: ubuntu-22.04
steps:
- id: get-id
name: Get a unique tag for this build
run: |
SHA=${{ github.sha }}; BRANCH_NAME=${{ github.base_ref || github.ref_name }};
BUILD_ID=$BRANCH_NAME-${SHA:0:8};
DOCKER_IMAGE="${{vars.GCP_DOCKER_REGISTRY}}/$REPO:$BUILD_ID"
echo "BUILD_ID=$BUILD_ID" >> "$GITHUB_OUTPUT";
echo "DOCKER_IMAGE=$DOCKER_IMAGE" >> "$GITHUB_OUTPUT";
- name: Print build id and image name
run: |
echo "BUILD_ID: ${{ steps.get-id.outputs.BUILD_ID }}";
echo "DOCKER_IMAGE: ${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- uses: actions/checkout@v4
# ✅ 1) Auth to GCP (this is where your SA key is used)
- name: Auth to GCP
uses: google-github-actions/auth@v2
with:
# using your existing secret that contains the SA JSON
credentials_json: ${{ secrets.GCP_SA_KEY }}
# ✅ 2) Install gcloud (no creds here)
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ vars.GCP_PROJECT_ID }}
export_default_credentials: true
- name: Configure Docker for GAR
run: |
gcloud auth configure-docker ${{vars.GCP_REGION}}-docker.pkg.dev
- name: Build the container image
run: |
docker build \
--build-arg BUILD_STEP=container \
--build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.BUILD_ID }} \
--file fab/d/actions-build.Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \
.;
- name: Container details
run: |
IMAGE_SIZE=`docker inspect -f "{{ .Size }}" ${{ steps.get-id.outputs.DOCKER_IMAGE }} | numfmt --to=si`;
echo "$IMAGE_SIZE container ${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- name: Push the container image
run: docker push ${{ steps.get-id.outputs.DOCKER_IMAGE }}

View File

@ -10,7 +10,7 @@ env:
jobs:
image-vulnerability-scan:
push-container-scan:
runs-on: ubuntu-22.04
steps:
@ -38,9 +38,10 @@ jobs:
password: ${{ secrets.docker_repo2_password }}
- name: Build the container image (quick, without PUBLIC_BUILD_VERSION)
# Commenting this from docker build for speed: --build-arg PUBLIC_BUILD_VERSION=$BUILD_ID \
run: |
docker build \
--build-arg BUILD_STEP=container \
--build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.BUILD_ID }} \
--file fab/d/actions-build.Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \
.;

View File

@ -8,7 +8,7 @@ env:
jobs:
container-build-and-push:
push-container:
runs-on: ubuntu-22.04
steps:
- id: get-id
@ -37,6 +37,7 @@ jobs:
- name: Build the container image
run: |
docker build \
--build-arg BUILD_STEP=container \
--build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.BUILD_ID }} \
--file fab/d/actions-build.Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \
@ -48,4 +49,4 @@ jobs:
echo "$IMAGE_SIZE container ${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- name: Push the container image
run: docker push ${{ steps.get-id.outputs.DOCKER_IMAGE }}
run: docker push ${{ steps.get-id.outputs.DOCKER_IMAGE }}

View File

@ -0,0 +1,84 @@
name: Reusable container push workflow
on:
workflow_call:
env:
REPO: ${{ github.repository }}
jobs:
push-npm:
runs-on: ubuntu-22.04
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: ${{ vars.NPM_REGISTRY }}
token: ${{ secrets.NPM_TOKEN }}
- run: npm install -g pnpm
- uses: actions/checkout@v4
- id: get-id
name: Get a unique tag for this build
run: |
SHA=${{ github.sha }}; BRANCH_NAME=${{ github.base_ref || github.ref_name }};
BUILD_ID=$BRANCH_NAME-${SHA:0:8};
DOCKER_IMAGE=${{ vars.docker_repo2_registry }}/$REPO:$BUILD_ID;
echo "BUILD_ID=$BUILD_ID" >> "$GITHUB_OUTPUT";
echo "DOCKER_IMAGE=$DOCKER_IMAGE" >> "$GITHUB_OUTPUT";
- name: Print build id and image name
run: |
echo "BUILD_ID: ${{ steps.get-id.outputs.BUILD_ID }}";
echo "DOCKER_IMAGE: ${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- name: Login to docker container registry
uses: docker/login-action@v3
with:
registry: ${{ vars.docker_repo2_registry }}
username: ${{ secrets.docker_repo2_username }}
password: ${{ secrets.docker_repo2_password }}
- name: Build the container image for npm build, with dependencies
run: |
docker build \
--build-arg BUILD_STEP=bundle \
--build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.BUILD_ID }} \
--file fab/d/actions-build.Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \
.;
- name: Extract lib files
run: |
image=${{ steps.get-id.outputs.DOCKER_IMAGE }}
source_path=/src/lib
destination_path=lib
container_id=$(docker create "$image" "pnpm build_npm")
docker container start -a $container_id
docker cp "$container_id:$source_path" "$destination_path"
docker rm "$container_id"
- name: Increment package version and push
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
git config --global user.name 'bot-build'
git config --global user.email 'techbots+build@gmetri.com'
export N=`node -p require\(\'./package.json\'\).name` && echo $N
pnpm version patch --message "v%s: $N [CI SKIP]"
npm publish
git push origin
git push --tags origin

View File

@ -8,7 +8,7 @@ env:
jobs:
npm-push:
push-npm:
runs-on: ubuntu-22.04
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
@ -16,20 +16,20 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: ${{ vars.NPM_REGISTRY }}
token: ${{ secrets.NPM_TOKEN }}
- name: Install npm dependencies
run: |
npm install -g pnpm
pnpm install
- run: npm install -g pnpm
- run: pnpm build
- uses: actions/checkout@v4
- name: Install npm dependencies and build
run: |
pnpm install
pnpm build_npm
- name: Increment package version and push
env:

86
.github/workflows/push-s3-gcp.yml vendored Normal file
View File

@ -0,0 +1,86 @@
name: Docker Image CI
on:
workflow_call:
# Org Secrets are available on push event. Not pull_request event.
env:
REPO: ${{ github.repository }}
REPO_SHORT_NAME: ${{ github.event.repository.name }}
jobs:
push-s3:
runs-on: ubuntu-22.04
steps:
- id: get-id
name: Get a unique tag for this build
run: |
SHA=${{ github.sha }}; BRANCH_NAME=${{ github.base_ref || github.ref_name }};
BUILD_ID=$BRANCH_NAME-${SHA:0:8};
DOCKER_IMAGE=${{ vars.GCP_DOCKER_REGISTRY }}/$REPO:$BUILD_ID;
echo "BUILD_ID=$BUILD_ID" >> "$GITHUB_OUTPUT";
echo "DOCKER_IMAGE=$DOCKER_IMAGE" >> "$GITHUB_OUTPUT";
- name: Print build id and image name
run: |
echo "BUILD_ID: ${{ steps.get-id.outputs.BUILD_ID }}";
echo "DOCKER_IMAGE: ${{ steps.get-id.outputs.DOCKER_IMAGE }}";
- uses: actions/checkout@v4
# ✅ 1) Auth to GCP (this is where your SA key is used)
- name: Auth to GCP
uses: google-github-actions/auth@v2
with:
# using your existing secret that contains the SA JSON
credentials_json: ${{ secrets.GCP_SA_KEY }}
# ✅ 2) Install gcloud (no creds here)
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ vars.GCP_PROJECT_ID }}
export_default_credentials: true
- name: Configure Docker for GAR
run: |
gcloud auth configure-docker ${{vars.GCP_REGION}}-docker.pkg.dev
- name: Build the container image for bundle step
run: |
docker build \
--build-arg BUILD_STEP=bundle \
--build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.BUILD_ID }} \
--file fab/d/actions-build.Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \
.;
- name: Extract cloud files
run: |
image=${{ steps.get-id.outputs.DOCKER_IMAGE }}
source_path=/cloud
destination_path=cloud
container_id=$(docker create "$image")
docker cp "$container_id:$source_path" "$destination_path"
docker rm "$container_id"
echo "Running: ls $destination_path"
ls $destination_path
- name: Upload cloud files
uses: https://git.gmetri.io/gmetribin/aws-cli-action@v1.0.0
env:
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }}
AWS_DEFAULT_REGION: ${{ vars.aws_default_region }}
with:
args: >
s3 cp \
--recursive \
--cache-control max-age=31536000\
--storage-class 'STANDARD_IA' \
cloud/ s3://${{ vars.aws_upload_bucket }}/${{ env.REPO_SHORT_NAME }}/${{ steps.get-id.outputs.BUILD_ID }}

View File

@ -11,7 +11,7 @@ env:
jobs:
s3-push:
push-s3:
runs-on: ubuntu-22.04
steps:
- id: get-id
@ -37,9 +37,10 @@ jobs:
username: ${{ secrets.docker_repo2_username }}
password: ${{ secrets.docker_repo2_password }}
- name: Build the container image
- name: Build the container image for bundle step
run: |
docker build \
--build-arg BUILD_STEP=bundle \
--build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.BUILD_ID }} \
--file fab/d/actions-build.Dockerfile \
--tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \

2
.gitignore vendored
View File

@ -129,4 +129,4 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.idea/

View File

@ -51,22 +51,6 @@ https://github.com/orgs/community/discussions/26625#discussioncomment-3252582
https://anchorecommunity.discourse.group/t/how-to-act-on-go-module-vulnerabilities/186/2
Within the image:
```bash
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b ./bin
#To check vulnerabilities
grypd .
#To save detailed output
grype $MY_IMAGE -o json > vuln.json
#OR
grype . -o json > vuln.json
#To explain the issue:
cat vuln.json | grype explain --id CVE-2023-24537
cat vuln2.json | grype explain --id CVE-2023-45853
```
## Getting the word "main" (branch name) during builds
If the build (was triggered by) is a merge of a pull request, GITHUB_BASE_REF will contain main.

12
README-build-notes.md Normal file
View File

@ -0,0 +1,12 @@
> https://git.gmetri.io/gmetribin/build-tools/src/branch/main/.github/README-build-notes.md
1) npm build -> push to npm `pnpm build_npm`
2) webpack build -> push assets to s3 Builds the docker. (Inside the docker `pnpm build`)
3) push docker with code that executes on. Docker image decides the start CMD. (Generally `pnpm start`)
4) image scan (dependent on docker build)
5) pushes the docker version to the cs-* repo
### 3 Push Docker
* Docker will be built with the Dockerfile `./fab/d/actions-build.Dockerfile`
* Context will be `.`
* env var `PUBLIC_BUILD_VERSION` will be passed as an env var Docker builds.

View File

@ -1,4 +1,4 @@
# deploy-tools
# build-tools
Github Action Workflows that can be reused, built by GMetri

View File

@ -1,9 +1,20 @@
#!/bin/bash
# https://gist.github.com/CSTDev/08c127680e3b5fae38c051da3e489351
# #For a fresh repo / Creating new releases
# git add -A;
# git commit -m "<commit msg>"
# #Setting a tag
# git tag -a -m "<tag msg>" v1.0.0
# git push --follow-tags
# #Moving a tag (eg: for major version retagging)
# git tag -fa v1
# git push --tags -f
# Based on https://gist.github.com/CSTDev/08c127680e3b5fae38c051da3e489351
# Commit with a log containing #minor or #major to increment the respective version number
#get highest tag number containing at least 2 dots
VERSION=`git describe --abbrev=0 --tags --match="v[0-9]*\.*\.*"`
VERSION=`git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.[0-9]*"`
#replace . with space so can split into an array
VERSION_BITS=(${VERSION//./ })