update scripts
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
**/node_modules/
|
**/node_modules/
|
||||||
**/dist/
|
**/dist/
|
||||||
k8s/
|
k8s/
|
||||||
|
**/.git/
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
name: Build and Publish
|
||||||
|
run-name: ${{ gitea.actor }} build 🚀
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Metadata:
|
||||||
|
runs-on: amd64
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.meta.outputs.version }}
|
||||||
|
git_commit: ${{ steps.meta.outputs.git_commit }}
|
||||||
|
build_date: ${{ steps.meta.outputs.build_date }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- id: meta
|
||||||
|
name: Derive build metadata
|
||||||
|
run: |
|
||||||
|
GIT_COMMIT=$(git rev-parse HEAD)
|
||||||
|
if git describe --tags --exact-match >/dev/null 2>&1; then
|
||||||
|
VERSION=$(git describe --tags --exact-match)
|
||||||
|
else
|
||||||
|
VERSION=$(git rev-parse --short=12 HEAD)
|
||||||
|
fi
|
||||||
|
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||||
|
echo "git_commit=$GIT_COMMIT" >> $GITHUB_OUTPUT
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "build_date=$BUILD_DATE" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
BuildAndDeployAmd64:
|
||||||
|
needs: Metadata
|
||||||
|
runs-on: amd64
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Build amd64 image
|
||||||
|
run: |
|
||||||
|
docker build \
|
||||||
|
--build-arg VERSION=${{ needs.Metadata.outputs.version }} \
|
||||||
|
--build-arg GIT_COMMIT=${{ needs.Metadata.outputs.git_commit }} \
|
||||||
|
--build-arg BUILD_DATE=${{ needs.Metadata.outputs.build_date }} \
|
||||||
|
--progress=plain \
|
||||||
|
-t matst80/otel-debug:latest \
|
||||||
|
.
|
||||||
|
- name: Push amd64 images
|
||||||
|
run: |
|
||||||
|
docker push matst80/otel-debug:latest
|
||||||
|
- name: Rollout amd64 otel deployment
|
||||||
|
run: |
|
||||||
|
kubectl rollout restart deployment/otel-debug-receiver -n monitoring
|
||||||
|
# - name: Rollout amd64 deployment (pin to version)
|
||||||
|
# run: |
|
||||||
|
# kubectl set image deployment/cart-actor-x86 -n cart cart-actor-amd64=registry.knatofs.se/go-otel-debug-amd64:${{ needs.Metadata.outputs.version }}
|
||||||
|
# # kubectl rollout status deployment/cart-actor-x86 -n cart
|
||||||
|
|
||||||
|
# BuildAndDeployArm64:
|
||||||
|
# needs: Metadata
|
||||||
|
# runs-on: arm64
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v4
|
||||||
|
# - name: Build arm64 image
|
||||||
|
# run: |
|
||||||
|
# docker build \
|
||||||
|
# --build-arg VERSION=${{ needs.Metadata.outputs.version }} \
|
||||||
|
# --build-arg GIT_COMMIT=${{ needs.Metadata.outputs.git_commit }} \
|
||||||
|
# --build-arg BUILD_DATE=${{ needs.Metadata.outputs.build_date }} \
|
||||||
|
# --progress=plain \
|
||||||
|
# -t registry.knatofs.se/go-otel-debug:latest \
|
||||||
|
# -t registry.knatofs.se/go-otel-debug:${{ needs.Metadata.outputs.version }} \
|
||||||
|
# .
|
||||||
|
# - name: Push arm64 images
|
||||||
|
# run: |
|
||||||
|
# docker push registry.knatofs.se/go-otel-debug:latest
|
||||||
|
# docker push registry.knatofs.se/go-otel-debug:${{ needs.Metadata.outputs.version }}
|
||||||
|
# - name: Rollout arm64 deployment (pin to version)
|
||||||
|
# run: |
|
||||||
|
# kubectl set image deployment/cart-actor-arm64 -n cart cart-actor-arm64=registry.knatofs.se/go-otel-debug:${{ needs.Metadata.outputs.version }}
|
||||||
|
# # kubectl rollout status deployment/cart-actor-arm64 -n cart
|
||||||
Reference in New Issue
Block a user