Skip to content

Readding /dnschecker endpoint #16

Readding /dnschecker endpoint

Readding /dnschecker endpoint #16

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
DOCKER_IMAGE_TAG: ${{ secrets.DOCKERHUB_REPO }}/assistant-api:$(date +'%Y%m%d%H%M')
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Code checkout
uses: actions/checkout@v4
- name: Login to docker container
uses: docker/login-action@v1
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: Build and push image
run: |
docker build . --file Dockerfile --tag "${{ env.DOCKER_IMAGE_TAG }}"
docker push "${{ env.DOCKER_IMAGE_TAG }}"
- name: Build and push image
run: |
docker build . --file Dockerfile --tag "${{ env.DOCKER_IMAGE_TAG }}"
docker push "${{ env.DOCKER_IMAGE_TAG }}"
- name: Checkout FluxCD repo
uses: actions/checkout@v2
with:
repository: minkzaw/fluxCD
path: fluxCD
token: ${{ secrets.REPO_ACCESS }}
- name: Update Kubernetes manifests
run: |
cd fluxCD
sed -i 's|image: .*|image: '"${{ env.DOCKER_IMAGE_TAG }}"'|' clusters/lima_k8s/default/assistant-api-deployment.yaml
- name: Commit and push changes
run: |
cd fluxCD
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add clusters/lima_k8s/default/assistant-api-deployment.yaml
git commit -m 'Update image to '"${{ env.DOCKER_IMAGE_TAG }}"
git push
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS }}