Add GitHub Actions workflow for code deployment
This commit is contained in:
parent
072c5d1d09
commit
63c117e837
|
|
@ -0,0 +1,35 @@
|
|||
name: Pull Code
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev_odex_base
|
||||
- dev_odex_hr
|
||||
- dev_odex30_accounting
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
environment:
|
||||
description: 'Select Server'
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- dev
|
||||
default: dev
|
||||
|
||||
jobs:
|
||||
|
||||
deploy_dev_server:
|
||||
name: Deploy to dev server <159.89.22.77>
|
||||
runs-on: odex30-runner
|
||||
if: |
|
||||
(github.ref == 'refs/heads/dev_odex_base' || github.ref == 'refs/heads/dev_odex_hr' || github.ref == 'dev_odex30_accounting') &&
|
||||
(github.event_name == 'push' ||
|
||||
(github.event_name == 'workflow_dispatch' && github.event.inputs.environment != ''))
|
||||
|
||||
steps:
|
||||
- name: Checkout And Restart Project
|
||||
run: |
|
||||
echo "** [INFO] Running on branch --> ${GITHUB_REF#refs/heads/}"
|
||||
sudo chmod +x /home/${{ secrets.CLIENT_USER }}/scripts/pull/pull_code.sh
|
||||
sudo /home/${{ secrets.CLIENT_USER }}/scripts/pull/pull_code.sh
|
||||
Loading…
Reference in New Issue