Skip to content

Instantly share code, notes, and snippets.

@jasperf
Last active April 22, 2022 10:39
Show Gist options
  • Save jasperf/5cd069b7e4e7ca2eb6209b76b67c04dd to your computer and use it in GitHub Desktop.
Save jasperf/5cd069b7e4e7ca2eb6209b76b67c04dd to your computer and use it in GitHub Desktop.
CI Github Action for Laravel with Vue and PHP Deployer incl. npm run prod and git commit
name: CD
# this workflow will deploy your application to production when
# a new release has been created in GitHub
on:
release:
types: [released]
push:
tags:
- 'v*'
# immediate release on push to master
# on:
# push:
# branches: [ master ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PUSH_TOKEN }}
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: '14.x'
- run: npm install
- run: npm run production
- name: Commit built assets
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git checkout -B deploy
git add -f public/
git commit -m "Build front-end assets"
git push -f origin deploy
- name: Deploy
uses: deployphp/action@v1
with:
# Private key for connecting to remote hosts. To generate private key:
# `ssh-keygen -o -t rsa -C '[email protected]'`.
# Required.
private-key: ${{ secrets.PRIVATE_KEY }}
dep: deploy prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment