Skip to content

Create deploy-docs.yml #1

Create deploy-docs.yml

Create deploy-docs.yml #1

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "master" ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./docs/Dockerfile
push: true
tags: irisnet/docs:${{ github.sha }}
- name: Set up Google Cloud SDK
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
export_default_credentials: true
- name: Deploy to GKE
run: |
gcloud container clusters get-credentials app --region ${{ secrets.GKE_REGION }} --project ${{ secrets.GKE_PROJECT }}
kubectl set image -n irisnet deployment/irisnet-docs frontend=irisnet/docs:${{ github.sha }}