Skip to content

v0.0.3-rollup-0821-deploy #38

v0.0.3-rollup-0821-deploy

v0.0.3-rollup-0821-deploy #38

name: Build Push and Deploy Docker Image for Frontend
on:
release:
types: [published] # This triggers the workflow when a release is published
jobs:
build:
runs-on: self-hosted
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./client/web
file: ./client/web/Dockerfile
push: true
tags: shaunly/real_char_frontend:latest
build-args: REACT_APP_BUILD_NUMBER=${{ github.ref }}
- name: Deploy to Kubernetes
if: ${{ contains(github.ref, 'deploy') }}
run: |
echo "${{ secrets.KUBECONFIG }}" | base64 --decode > ./kubeconfig.yaml
export KUBECONFIG=./kubeconfig.yaml
kubectl rollout restart deployment react-dev-deployment