Skip to content

feature: webhook (#50) #21

feature: webhook (#50)

feature: webhook (#50) #21

Workflow file for this run

name: Build and deploy docker image on release
on:
push:
tags: ['*']
env:
REGISTRY: ghcr.io
jobs:
deployment:
environment: yc-deploy
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Lower case image name
run: |
echo "IMAGE_NAME=${REPO,,}" >>${GITHUB_ENV}
env:
REPO: ${{ github.repository }}
- name: Checkout repository
uses: actions/checkout@v2
- name: Log in to the Container registry
uses: docker/login-action@v1.10.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2.7.0
with:
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
- name: Deploy image
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
proxy_host: ${{ secrets.PROXY_HOST }}
proxy_username: ${{ secrets.PROXY_USERNAME }}
proxy_key: ${{ secrets.PROXY_KEY }}
proxy_port: ${{ secrets.PROXY_PORT }}
script: TAG=${{ github.ref_name }} ./deploy.sh