diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d568665 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,14 @@ +name: Deoloy +on: [push] + +jobs: + deploy: + runs-on: ubuntu-latest + name: A Laravel deploy action example + steps: + - name: test + uses: yankewei/laravel-deploy-action@main + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} \ No newline at end of file diff --git a/Envoy.blade.php b/Envoy.blade.php new file mode 100644 index 0000000..f9c4467 --- /dev/null +++ b/Envoy.blade.php @@ -0,0 +1,6 @@ +@servers(['web' => '8.210.56.133']) + +@task('deploy') + cd /path/to/site + git pull origin master +@endtask \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7fd9d7f --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# laravel-deploy-action +Automatically deploy your Laravel app to remote server diff --git a/action.yaml b/action.yaml new file mode 100644 index 0000000..f7cc250 --- /dev/null +++ b/action.yaml @@ -0,0 +1,32 @@ +name: 'Laravel deploy action' +description: 'Automatically deploy your Laravel application to remote server' +inputs: + host: + description: 'The remote server ip, support IPV4 only' + required: true + username: + description: 'The ssh login user name' + required: true + ssh_private_key: + description: 'The ssh private key, will be stored into .ssh/github_action' + requierd: true + +runs: + using: 'composite' + steps: + - uses: actions/checkout@v3 + + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + tools: composer:v2 + + - name: deploy your application + shell: bash + run: | + mkdir ~/.ssh + touch ~/.ssh/github_action + echo '${{ inputs.ssh_private_key }}' >> ~/.ssh/github_action + cd ${{ github.workspace }} + composer require "laravel/envoy:^2.0" + cat Envoy.blade.php