Skip to content

Workflow file for this run

---
name: Publish Docker image
on: push
jobs:
build:
strategy:
fail-fast: false
matrix:
bots:
- Echo
name: Docker Build
runs-on: ubuntu-latest
outputs:
docker_image_tag: ${{ steps.meta.outputs.tags }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
polinetwork/${{ matrix.bots }}
tags: |
type=sha
- name: Build
uses: docker/build-push-action@v3
with:
push: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main'}}
context: ${{ matrix.bots }}/Main
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Update-K8s-Manifests-Dev:
name: Update K8s Deployment Manifest with Image Version
needs: build
if: ${{ github.ref == 'refs/heads/dev'}}
strategy:
fail-fast: false
matrix:
bots:
- Echo
uses: ./.github/workflows/cd-slave.yaml
with:
docker_image_tag: ${{needs.build.outputs.docker_image_tag}}
app: newbot
environment: dev
secrets:
CD_DEPLOY_KEY: ${{ secrets.CD_DEPLOY_KEY }}
Update-K8s-Manifests-Prod:
name: Update K8s Deployment Manifest with Image Version
needs: build
if: ${{github.ref == 'refs/heads/main'}}
strategy:
fail-fast: false
matrix:
bots:
- Echo
uses: ./.github/workflows/cd-slave.yaml
with:
docker_image_tag: ${{needs.build.outputs.docker_image_tag}}
app: newbot
environment: prod
secrets:
CD_DEPLOY_KEY: ${{ secrets.CD_DEPLOY_KEY }}