-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from satyakresna/master
Fix issue #55 and add feature deploy with Github Actions
- Loading branch information
Showing
6 changed files
with
11,547 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: CI-CD | ||
|
||
on: push | ||
|
||
jobs: | ||
compile-assets: | ||
name: Compile assets | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Build jS | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: NPM Build | ||
run: | | ||
npm run prod | ||
cat public/mix-manifest.json # see version in log | ||
- name: Upload compile assets | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: assets | ||
path: public | ||
test-php: | ||
name: Test/Lint PHP | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: 7.3 | ||
extensions: mbstring, bmath | ||
- name: Composer install | ||
run: composer install | ||
- name: Generate artisan key | ||
run: | | ||
cp .env.example .env | ||
php artisan key:generate | ||
- name: Run tests | ||
run: ./vendor/bin/phpunit | ||
deploy: | ||
name: Deploy to production | ||
runs-on: ubuntu-latest | ||
needs: [compile-assets, test-php] | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download build assets | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: assets | ||
path: public | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: 7.3 | ||
extensions: mbstring, bmath | ||
- name: Composer install | ||
run: composer install | ||
- name: Setup Deployer | ||
uses: atymic/deployer-php-action@master | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} | ||
- name: Deploy to Prod | ||
run: dep deploy production --tag=${{ env.GITHUB_REF }} -vvv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.