Skip to content

Update ci.yaml

Update ci.yaml #80

Workflow file for this run

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