diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 00000000..c908c50d --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,49 @@ +name: Deploy + +on: + push: + branches: [ master ] + +jobs: + build: + name: Build assets and deploy + runs-on: ubuntu-latest + + steps: + + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.3 + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Build assets + uses: actions/setup-node@v1 + with: + node-version: 12.x + + - run: npm install + - run: npm run build + + - name: Deploy + uses: musps/action-deployer-php@master + with: + args: deploy production + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} diff --git a/deploy.php b/deploy.php index d066990f..07c9fb7e 100644 --- a/deploy.php +++ b/deploy.php @@ -22,8 +22,8 @@ add('shared_dirs', [ 'config/sites', ]); -host('production') - ->hostname('185.237.67.190') +host('185.237.67.190') + ->stage('production') ->user('p546128') ->forwardAgent() ->multiplexing()