Skip to content

Feat/ois/nextjs

Feat/ois/nextjs #54

Workflow file for this run

name: Deploy
on:
pull_request:
types: [ready_for_review, opened, reopened, synchronize]
branches:
- main
jobs:
build-and-deploy:
name: Build and deploy to environment when pull request is created
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Get Short SHA
id: vars
run: |
echo ::set-output name=sha_short::$(git rev-parse --short=7 ${{ github.sha }})
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: oyvindis/climate-gui:${{ steps.vars.outputs.sha_short }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
- name: Set K8s context
id: setcontext
uses: azure/k8s-set-context@v1
with:
method: kubeconfig
kubeconfig: ${{ secrets.KUBE_CONFIG }}
- uses: azure/k8s-bake@v2
with:
renderEngine: "helm"
helmChart: "./helm-sources/"
helm-version: "latest"
id: bake
- name: Deploy to Kubernetes cluster
uses: Azure/[email protected]
with:
manifests: ${{ steps.bake.outputs.manifestsBundle }}
images: oyvindis/climate-gui:${{ steps.vars.outputs.sha_short }}
kubectl-version: 'latest'
namespace: 'dev'