Skip to content

Fix deploy

Fix deploy #4

Workflow file for this run

name: Deploy
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install GitVersion
uses: GitTools/actions/gitversion/setup@a41619580c25efb59dfc062e92990914141abcad # v0.10.2
with:
versionSpec: '5.5.0'
- uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
with:
dotnet-version: '3.1.x'
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Run GitVersion
id: gitversion
uses: GitTools/actions/gitversion/execute@a41619580c25efb59dfc062e92990914141abcad # v0.10.2
- name: Echo version
run: echo ${{ steps.gitversion.outputs.majorMinorPatch }}
- name: Build image and push
uses: docker/build-push-action@v2
with:
context: .
file: ./CaptchaBot/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/captchabot:latest
${{ secrets.DOCKER_HUB_USERNAME }}/captchabot:${{ steps.gitversion.outputs.majorMinorPatch }}
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/captchabot:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/captchabot:buildcache,mode=max
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: ./update.captchabot.sh