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:
|
||||
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
|
||||
GIT_SSL_NO_VERIFY: "true"
|
||||
DOCKER_HOST: tcp://localhost:2375
|
||||
DOCKER_TLS_VERIFY: "0"
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
@@ -23,46 +19,33 @@ jobs:
|
||||
with:
|
||||
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
|
||||
id: tag
|
||||
run: echo "TAG=${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Login to Gitea registry
|
||||
run: |
|
||||
echo "${{ secrets.CI_TOKEN }}" | docker login ${{ env.REGISTRY }} \
|
||||
-u chemavx --password-stdin
|
||||
- name: Build and push bot image
|
||||
uses: aevea/action-kaniko@master
|
||||
with:
|
||||
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
|
||||
run: |
|
||||
docker build \
|
||||
-f Dockerfile \
|
||||
-t ${{ env.IMAGE_BOT }}:${{ steps.tag.outputs.TAG }} \
|
||||
-t ${{ env.IMAGE_BOT }}:latest \
|
||||
.
|
||||
|
||||
- name: Build API image
|
||||
run: |
|
||||
docker build \
|
||||
-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: Build and push API image
|
||||
uses: aevea/action-kaniko@master
|
||||
with:
|
||||
registry: git.chemavx.xyz
|
||||
username: chemavx
|
||||
password: ${{ secrets.CI_TOKEN }}
|
||||
image: chemavx/polymarket-bot-api
|
||||
tag: ${{ steps.tag.outputs.TAG }}
|
||||
path: .
|
||||
build_file: Dockerfile.api
|
||||
extra_args: --insecure --skip-tls-verify
|
||||
|
||||
- name: Update k8s manifests
|
||||
run: |
|
||||
@@ -74,9 +57,9 @@ jobs:
|
||||
git clone ${{ env.K8S_MANIFESTS_REPO }} /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
|
||||
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
|
||||
sed -i "s|imagePullPolicy: Never|imagePullPolicy: Always|g" \
|
||||
polymarket-bot/deployment-bot.yaml \
|
||||
|
||||
Reference in New Issue
Block a user