Skip to content

Commit

Permalink
Merge pull request #13 from oanhnn/develop
Browse files Browse the repository at this point in the history
Version 3.1.x
  • Loading branch information
oanhnn authored Oct 27, 2020
2 parents 6a08c04 + 7103587 commit 5a1a8cc
Show file tree
Hide file tree
Showing 13 changed files with 322 additions and 123 deletions.
48 changes: 36 additions & 12 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
/examples
/hooks
/.editorconfig
/.git
/.gitattributes
/.github
/.gitignore
/.travis.yml
/Dockerfile
/LICENSE
/README.md
/CHANGELOG.md
# Other files #
################
examples

# User specific & automatically generated files #
#################################################
*.log
*.md
.travis.yml
.github
README.md
CHANGELOG.md

# IDE and editor specific files #
#################################
nbproject
.idea
.vscode
.editorconfig

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

# Git config #
##############
.git
.gitignore
.gitattributes
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
*.woff2 binary

# Exclude unused files
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/CHANGELOG.md export-ignore
13 changes: 12 additions & 1 deletion CHANGELOG.md → .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.



## [v3.1.0] - 2020-10-27

### Changed
- Update to latest laravel-echo-server version
- Remove dangling lock file before start
- Change GitHub Workflow build, test and release




## [v3.0.0] - 2020-04-13

### Added
Expand Down Expand Up @@ -84,7 +94,8 @@ First release



[Unreleased]: https://github.com/oanhnn/docker-laravel-echo-server/compare/v3.0.0...develop
[Unreleased]: https://github.com/oanhnn/docker-laravel-echo-server/compare/v3.1.0...develop
[v3.1.0]: https://github.com/oanhnn/docker-laravel-echo-server/compare/v3.0.0...v3.1.0
[v3.0.0]: https://github.com/oanhnn/docker-laravel-echo-server/compare/v2.1.1...v3.0.0
[v2.1.1]: https://github.com/oanhnn/docker-laravel-echo-server/compare/v2.1.0...v2.1.1
[v2.1.0]: https://github.com/oanhnn/docker-laravel-echo-server/compare/v2.0.0...v2.1.0
Expand Down
42 changes: 21 additions & 21 deletions README.md → .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@

Alpine based [Laravel Echo Server](https://github.com/tlaverdure/laravel-echo-server) image.

[![Build Status](https://github.com/oanhnn/docker-laravel-echo-server/workflows/CI-CD/badge.svg)](https://github.com/oanhnn/docker-laravel-echo-server/actions)
[![Docker Pulls](https://img.shields.io/docker/pulls/oanhnn/laravel-echo-server.svg)](https://hub.docker.com/r/oanhnn/laravel-echo-server)
[![Docker Stars](https://img.shields.io/docker/stars/oanhnn/laravel-echo-server.svg)](https://hub.docker.com/r/oanhnn/laravel-echo-server)
[![Build Status](https://github.com/oanhnn/docker-laravel-echo-server/workflows/CI/badge.svg)](https://github.com/oanhnn/docker-laravel-echo-server/actions)
[![Software License](https://img.shields.io/github/license/oanhnn/docker-laravel-echo-server.svg)](https://github.com/oanhnn/docker-laravel-echo-server/blob/master/LICENSE)

## Tags
## Features

- [x] Build from official NodeJS docker image
- [x] Install latest `laravel-echo-server`
- [x] Tagging follow [sermatic version](https://semver.org/spec/v2.0.0.html)
- [x] Auto generate config file
- [x] Auto build and push by Github Workflow

### Version tags
## Tags

Git tag | Image tag | Badges
---------|-----------|-------
`v1.0.0` | `1.0.0` | [![Docker Image Size](https://img.shields.io/microbadger/image-size/oanhnn/laravel-echo-server/1.0.0.svg)](https://microbadger.com/images/oanhnn/laravel-echo-server:1.0.0) [![Docker Image Layers](https://img.shields.io/microbadger/layers/oanhnn/laravel-echo-server/1.0.0.svg)](https://microbadger.com/images/oanhnn/laravel-echo-server:1.0.0)
`v2.0.0` | `2.0.0` | [![Docker Image Size](https://img.shields.io/microbadger/image-size/oanhnn/laravel-echo-server/2.0.0.svg)](https://microbadger.com/images/oanhnn/laravel-echo-server:2.0.0) [![Docker Image Layers](https://img.shields.io/microbadger/layers/oanhnn/laravel-echo-server/2.0.0.svg)](https://microbadger.com/images/oanhnn/laravel-echo-server:2.0.0)
`v2.1.0` | `2.1.0` | [![Docker Image Size](https://img.shields.io/microbadger/image-size/oanhnn/laravel-echo-server/2.1.0.svg)](https://microbadger.com/images/oanhnn/laravel-echo-server:2.1.0) [![Docker Image Layers](https://img.shields.io/microbadger/layers/oanhnn/laravel-echo-server/2.1.0.svg)](https://microbadger.com/images/oanhnn/laravel-echo-server:2.1.0)
`v2.1.1` | `2.1.1` | [![Docker Image Size](https://img.shields.io/microbadger/image-size/oanhnn/laravel-echo-server/2.1.1.svg)](https://microbadger.com/images/oanhnn/laravel-echo-server:2.1.1) [![Docker Image Layers](https://img.shields.io/microbadger/layers/oanhnn/laravel-echo-server/2.1.1.svg)](https://microbadger.com/images/oanhnn/laravel-echo-server:2.1.1)
`v3.0.0` | `3.0.0` | [![Docker Image Size](https://img.shields.io/microbadger/image-size/oanhnn/laravel-echo-server/3.0.0.svg)](https://microbadger.com/images/oanhnn/laravel-echo-server:3.0.0) [![Docker Image Layers](https://img.shields.io/microbadger/layers/oanhnn/laravel-echo-server/3.0.0.svg)](https://microbadger.com/images/oanhnn/laravel-echo-server:3.0.0)
Image `oanhnn/laravel-echo-server`

### Branch tags
- `X.Y.Z` - the PATH version (git tag `vX.Y.Z`)
- `X.Y` - the MINOR version
- `X` - the MAJOR version
- `latest` - the latest version

- `latest` - branch `master`
- `develop` - branch `develop`
Image `ghcr.io/oanhnn/laravel-echo-server`

## Features
- `edge` - the edge version, it is newest code from branch `master`
- `nightly` - the nightly version, it is builded daily at 8:20 AM UTC

- [x] Base from `node:lts-alpine` image
- [x] Install latest `laravel-echo-server`
- [x] Auto generate config file
> NOTE: Using sematic version for production
## Requirement

- Docker Engine 1.13+

## Usage
Expand All @@ -40,7 +40,7 @@ Git tag | Image tag | Badges
Run laravel-echo-server by command

```bash
$ docker run -d -p 6001:6001 -v $(pwd):/appoanhnn/laravel-echo-server
$ docker run -d -p 6001:6001 -v $(pwd):/app oanhnn/laravel-echo-server
```


Expand Down Expand Up @@ -142,5 +142,5 @@ If you would like to help take a look at the [list of issues](https://github.com
## License

This project is released under the MIT License.
Copyright © [Oanh Nguyen](https://github.com/oanhnn)
Copyright © 2020 [Oanh Nguyen](https://github.com/oanhnn)
Please see [License File](https://github.com/oanhnn/docker-laravel-echo-server/blob/master/LICENSE) for more information.
75 changes: 0 additions & 75 deletions .github/workflows/ci-cd.yml

This file was deleted.

136 changes: 136 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: CI

on:
# Build the nightly version at 8:20 AM UTC
schedule:
- cron: "20 8 * * *"

# For all pushes to the main branch run the tests and push the image to the
# GitHub Container Registry under an edge tag
push:
branches:
- master

# For all PRs to the main branch run the tests
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
env:
DOCKER_IMAGE: oanhnn/laravel-echo-server
strategy:
fail-fast: false
matrix:
database:
- redis
- sqlite
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setting up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx-

- name: Build test
id: docker_test
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
context: .
file: ./Dockerfile
pull: true
load: true
tags: ${{ env.DOCKER_IMAGE }}:test

- name: Setup docker-compose
run: |
mkdir ./ci-test
cp ./examples/${{ matrix.database }}.yml ./ci-test/docker-compose.yml
sed -i "s|oanhnn/laravel-echo-server:.*|oanhnn/laravel-echo-server:test|g" ./ci-test/docker-compose.yml
- name: Run with docker
run: |
docker-compose up -d
sleep 10s
docker-compose ps
curl --silent --show-error --fail http://127.0.0.1:6001/socket.io/socket.io.js
docker-compose down
working-directory: ./ci-test

push:
runs-on: ubuntu-latest
needs: [ 'test' ]
if: github.event_name != 'pull_request'
env:
DOCKER_IMAGE: ghcr.io/oanhnn/laravel-echo-server
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare
id: prepare
run: |
VERSION=test
if [ "${{ github.event_name }}" = "schedule" ]; then
VERSION=nightly
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then
VERSION=edge
fi
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION=pr-${{ github.event.number }}
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
if [ "${{ github.event_name }}" = "push" ]; then
TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}"
fi
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Setting up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
context: .
file: ./Dockerfile
pull: true
push: true
tags: ${{ steps.prepare.outputs.tags }}

Loading

0 comments on commit 5a1a8cc

Please sign in to comment.