Skip to content

run php cs fixer

run php cs fixer #104

name: Build And Deploy Release
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get all release versions
id: get_all_versions
run: |
echo APP_VERSION=$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g" | sed -E "s/v?([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z]+(\.[0-9]+)?)?/\1.\2.\3\4/g") >> $GITHUB_ENV
echo APP_VERSIONS=$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g" | sed -E "s/v?([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z]+(\.[0-9]+)?)?/\1.\2.\3\4 \1.\2\4 \1\4/g") >> $GITHUB_ENV
- name: Publish to Docker Repository
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: guystlr/by-night
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
buildargs: APP_VERSION
tags: 'stable,${{ env.APP_VERSIONS }}'
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to production
uses: appleboy/ssh-action@master
env:
BY_NIGHT_PATH: ${{ secrets.BY_NIGHT_PATH }}
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
envs: BY_NIGHT_PATH
script_stop: true
script: |
cd $BY_NIGHT_PATH
sudo /bin/bash ./deploy.sh