Skip to content

Commit

Permalink
Merge branch 'release/1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
aronnebrivio committed Mar 6, 2021
2 parents da83dbd + 2779fe4 commit a556e83
Show file tree
Hide file tree
Showing 24 changed files with 251 additions and 558 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI/CD

on: push

jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: blog_testing
ports:
- 3306
steps:
- uses: actions/checkout@v2
- name: Copy .env
run: cp environments/ci/.env .env
- name: Install Dependencies
run: composer install --ignore-platform-reqs
- name: Run Migrations
run: php artisan migrate
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
- name: Run PHPUnit
run: vendor/bin/phpunit
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}

deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2

- run: cp environments/production/Dockerfile Dockerfile

- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{secrets.HEROKU_APP_NAME}}
heroku_email: ${{secrets.HEROKU_EMAIL}}
usedocker: true
docker_build_args: |
DB_HOST
DB_DATABASE
DB_USERNAME
DB_PASSWORD
env:
DB_HOST: ${{secrets.PROD_DB_HOST}}
DB_DATABASE: ${{secrets.PROD_DB_DATABASE}}
DB_USERNAME: ${{secrets.PROD_DB_USERNAME}}
DB_PASSWORD: ${{secrets.PROD_DB_PASSWORD}}
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
/.idea
Homestead.json
Homestead.yaml
.env
.env*
!.env.example
/log
.phpunit.result.cache
/.vscode

.vscode/*
!.vscode/settings.json
!.vscode/launch.json

private/tmp
40 changes: 0 additions & 40 deletions .gitlab-ci.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html": "${workspaceRoot}"
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9003
}
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"phpunit.phpunit": "/var/www/html/vendor/bin/phpunit",
"phpunit.command": "docker-compose run --rm blog-lumen",
"phpunit.paths": {
"${workspaceFolder}": "/var/www/html"
},
"phpunit.args": [
"--coverage-html /tmp"
]
}
65 changes: 0 additions & 65 deletions Envoy.blade.php

This file was deleted.

13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Blog backend
[![CI/CD](https://github.com/aronnebrivio/a-lumen-blog/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/aronnebrivio/a-lumen-blog/actions/workflows/ci-cd.yml)
[![Coverage Status](https://coveralls.io/repos/github/aronnebrivio/a-lumen-blog/badge.svg?branch=master)](https://coveralls.io/github/aronnebrivio/a-lumen-blog?branch=master)
[![LICENSE](https://img.shields.io/badge/license-MIT-gold.svg)](https://github.com/aronnebrivio/aronnebrivio.github.io/blob/master/LICENSE)

> I'm currently porting this project from Gitlab. I used to automate the deploy with Gitlab CI using [Envoy](https://laravel.com/docs/8.x/envoy). I'll try to use the same approach with Github workflows and, once it will be up and running on a production endpoint, I'll try out new deploy technologies.
[Lumen](https://lumen.laravel.com/) project providing an API to a blog environment, with Users, Posts and Comments.

Documentation can be found [here](https://documenter.getpostman.com/view/4711074/SVmr11U3?version=latest).
Expand Down Expand Up @@ -31,11 +31,12 @@ Tests are under `/tests` folder, run it with `phpunit`.
- [x] Automated PHP-CS-Fixer
- [x] Redis cache
- [x] Clean up local Docker environment
- [ ] Review CI Docker environment
- [ ] Use Github workflow
- [ ] Setup a simple production environment
- [X] Review CI Docker environment
- [X] Use Github workflow
- [X] Setup a simple production environment
- [X] Containerized infrastructure for server
- [ ] Makefile
- [ ] Containerized infrastructure for server
- [ ] Pagination

## License
Copyright (c) 2020 Aronne Brivio. Released under the MIT License. See [LICENSE](https://github.com/aronnebrivio/a-lumen-blog/blob/master/LICENSE) for details.
Loading

0 comments on commit a556e83

Please sign in to comment.