feat: add CRD Application #1
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: Build KubeAGI arcadia image base on pr | |
on: | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
env: | |
GO_VER: 1.20 | |
GO_TAGS: "" | |
PR_NUMBER: ${{ github.event.number }} | |
jobs: | |
image: | |
if: github.repository == 'kubeagi/arcadia' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set Variable | |
id: set-env | |
run: | | |
TAG=$(git describe --tags --abbrev=0 --match 'v*' 2> /dev/null) || true | |
if [ -z "$TAG" ]; then | |
echo "No tag found, use v0.0.1 as default" | |
TAG=v0.0.1 | |
fi | |
echo "TAG=${TAG}" >> $GITHUB_OUTPUT | |
echo "DATE=$(TZ=Asia/Shanghai date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Show Variable | |
run: echo "varibables ${{ steps.set-env.outputs.TAG }}-${{ steps.set-env.outputs.DATE }}" | |
- name: Login to the dockerhub Registry | |
uses: docker/login-action@v2 | |
with: | |
username: kubebb | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- uses: benjlevesque/[email protected] | |
name: Get short commit sha | |
id: short-sha | |
- name: Build and push | |
id: push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64 | |
tags: | | |
kubebb/arcadia:${{ env.PR_NUMBER }} | |
push: true | |
build-args: | | |
GO_VER=${{ env.GO_VER }} | |
GO_TAGS=${{ env.GO_TAGS }} | |
BUILD_ID=${{ env.SEMREV_LABEL }} | |
BUILD_DATE=${{ env.BUILD_DATE }} | |
- name: Build data processing image | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./data-processing | |
file: ./data-processing/Dockerfile | |
platforms: linux/amd64 | |
tags: | | |
kubebb/arcadia-data-processing:${{ env.PR_NUMBER }} | |
push: true |