Skip to content

Deploy on push

Deploy on push #7

Workflow file for this run

name: Docker
on:
push:
branches:
- master
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set version tag
id: vars
run: echo ::set-output name=version::$(git log -1 --pretty=%h)
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: |
mark3labs/louper-web:${{ steps.vars.outputs.version }}
mark3labs/louper-web:latest
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Save DigitalOcean kubeconfig with short-lived credentials
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 662138bb-8236-4da5-8c6d-c602fb6eef82
- name: Deploy to DigitalOcean Kubernetes
run: kubectl apply -f $GITHUB_WORKSPACE/.k8s
- name: Verify deployment
run: kubectl rollout status deployment/louper