Skip to content

ci

ci #11

Workflow file for this run

name: ci
on:
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Checkout Branch
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: https://registry-intl.ap-southeast-5.aliyuncs.com
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Server
uses: docker/build-push-action@v2
with:
context: .
file: ./build/Dockerfile.server
push: true
tags: registry-intl.ap-southeast-5.aliyuncs.com/fachrin/reactive-cache-server:latest
- name: Build and Push Worker
uses: docker/build-push-action@v2
with:
context: .
file: ./build/Dockerfile.worker
push: true
tags: registry-intl.ap-southeast-5.aliyuncs.com/fachrin/reactive-cache-worker:latest
deploy:
name: Production Deployment
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout Branch
uses: actions/checkout@v4
- name: Prepare Deployment Source
run: |
sed -ie "s/{{build_date}}/$(date)/g" deployment.yaml
- name: Trigger Deployment
uses: actions-hub/kubectl@v1.29.0
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_DATA }}
with:
args: apply -f deployment.yaml --validate=false