feat: replace Docker CLI builds with Kaniko (no daemon needed in job)
CI/CD / build-and-push (push) Successful in 2m35s
CI/CD / build-and-push (push) Successful in 2m35s
This commit is contained in:
+24
-41
@@ -7,12 +7,8 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: git.chemavx.xyz
|
REGISTRY: git.chemavx.xyz
|
||||||
IMAGE_BOT: git.chemavx.xyz/chemavx/polymarket-bot
|
|
||||||
IMAGE_API: git.chemavx.xyz/chemavx/polymarket-bot-api
|
|
||||||
K8S_MANIFESTS_REPO: http://chemavx:${{ secrets.CI_TOKEN }}@gitea.gitea.svc.cluster.local:3000/chemavx/k8s-manifests.git
|
K8S_MANIFESTS_REPO: http://chemavx:${{ secrets.CI_TOKEN }}@gitea.gitea.svc.cluster.local:3000/chemavx/k8s-manifests.git
|
||||||
GIT_SSL_NO_VERIFY: "true"
|
GIT_SSL_NO_VERIFY: "true"
|
||||||
DOCKER_HOST: tcp://localhost:2375
|
|
||||||
DOCKER_TLS_VERIFY: "0"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
@@ -23,46 +19,33 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ssl-verify: false
|
ssl-verify: false
|
||||||
|
|
||||||
- name: Install Docker CLI
|
|
||||||
run: curl -fsSL https://get.docker.com | sh
|
|
||||||
|
|
||||||
- name: Test Docker connection
|
|
||||||
run: docker info
|
|
||||||
|
|
||||||
- name: Set image tag
|
- name: Set image tag
|
||||||
id: tag
|
id: tag
|
||||||
run: echo "TAG=${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
|
run: echo "TAG=${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Login to Gitea registry
|
- name: Build and push bot image
|
||||||
run: |
|
uses: aevea/action-kaniko@master
|
||||||
echo "${{ secrets.CI_TOKEN }}" | docker login ${{ env.REGISTRY }} \
|
with:
|
||||||
-u chemavx --password-stdin
|
registry: git.chemavx.xyz
|
||||||
|
username: chemavx
|
||||||
|
password: ${{ secrets.CI_TOKEN }}
|
||||||
|
image: chemavx/polymarket-bot
|
||||||
|
tag: ${{ steps.tag.outputs.TAG }}
|
||||||
|
path: .
|
||||||
|
build_file: Dockerfile
|
||||||
|
extra_args: --insecure --skip-tls-verify
|
||||||
|
|
||||||
- name: Build bot image
|
- name: Build and push API image
|
||||||
run: |
|
uses: aevea/action-kaniko@master
|
||||||
docker build \
|
with:
|
||||||
-f Dockerfile \
|
registry: git.chemavx.xyz
|
||||||
-t ${{ env.IMAGE_BOT }}:${{ steps.tag.outputs.TAG }} \
|
username: chemavx
|
||||||
-t ${{ env.IMAGE_BOT }}:latest \
|
password: ${{ secrets.CI_TOKEN }}
|
||||||
.
|
image: chemavx/polymarket-bot-api
|
||||||
|
tag: ${{ steps.tag.outputs.TAG }}
|
||||||
- name: Build API image
|
path: .
|
||||||
run: |
|
build_file: Dockerfile.api
|
||||||
docker build \
|
extra_args: --insecure --skip-tls-verify
|
||||||
-f Dockerfile.api \
|
|
||||||
-t ${{ env.IMAGE_API }}:${{ steps.tag.outputs.TAG }} \
|
|
||||||
-t ${{ env.IMAGE_API }}:latest \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push bot image
|
|
||||||
run: |
|
|
||||||
docker push ${{ env.IMAGE_BOT }}:${{ steps.tag.outputs.TAG }}
|
|
||||||
docker push ${{ env.IMAGE_BOT }}:latest
|
|
||||||
|
|
||||||
- name: Push API image
|
|
||||||
run: |
|
|
||||||
docker push ${{ env.IMAGE_API }}:${{ steps.tag.outputs.TAG }}
|
|
||||||
docker push ${{ env.IMAGE_API }}:latest
|
|
||||||
|
|
||||||
- name: Update k8s manifests
|
- name: Update k8s manifests
|
||||||
run: |
|
run: |
|
||||||
@@ -74,9 +57,9 @@ jobs:
|
|||||||
git clone ${{ env.K8S_MANIFESTS_REPO }} /tmp/k8s-manifests
|
git clone ${{ env.K8S_MANIFESTS_REPO }} /tmp/k8s-manifests
|
||||||
cd /tmp/k8s-manifests
|
cd /tmp/k8s-manifests
|
||||||
|
|
||||||
sed -i "s|image: .*polymarket-bot[^-].*|image: ${{ env.IMAGE_BOT }}:${TAG}|g" \
|
sed -i "s|image: .*polymarket-bot[^-].*|image: git.chemavx.xyz/chemavx/polymarket-bot:${TAG}|g" \
|
||||||
polymarket-bot/deployment-bot.yaml
|
polymarket-bot/deployment-bot.yaml
|
||||||
sed -i "s|image: .*polymarket-bot-api.*|image: ${{ env.IMAGE_API }}:${TAG}|g" \
|
sed -i "s|image: .*polymarket-bot-api.*|image: git.chemavx.xyz/chemavx/polymarket-bot-api:${TAG}|g" \
|
||||||
polymarket-bot/deployment-api.yaml
|
polymarket-bot/deployment-api.yaml
|
||||||
sed -i "s|imagePullPolicy: Never|imagePullPolicy: Always|g" \
|
sed -i "s|imagePullPolicy: Never|imagePullPolicy: Always|g" \
|
||||||
polymarket-bot/deployment-bot.yaml \
|
polymarket-bot/deployment-bot.yaml \
|
||||||
|
|||||||
Reference in New Issue
Block a user