Unify GH actions.

This commit is contained in:
Buster "Silver Eagle" Neece 2020-01-22 17:52:49 -06:00 committed by GitHub
parent 2d6c9d4f1b
commit 31cce0f8d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 20 deletions

48
.github/workflows/default.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: Build, Test and Publish
on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
- cron: '0 2 * * 0' # Weekly on Sundays at 02:00
jobs:
publish:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: Publish to Docker Hub
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: azuracast/azuracast_web_v2
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
cache: ${{ github.event_name != 'schedule' }}
test:
needs: [publish]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: Set up test environment
run: |
cp azuracast.sample.env azuracast.env
cp docker-compose.sample.yml docker-compose.yml
cp docker-compose.testing.yml docker-compose.override.yml
chmod 777 tests/_output/
docker-compose build web
docker-compose run --user="azuracast" --rm web azuracast_install
- name: Run test suite
run: |
docker-compose run --user="azuracast" --rm web composer test
- name: Echo test output directory
if: failure()
run: |
cat tests/_output/*.html

View File

@ -1,20 +0,0 @@
name: Publish to Registries
on:
push:
branches:
- master
schedule:
- cron: '0 2 * * 0' # Weekly on Sundays at 02:00
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Publish to Docker Hub
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: azuracast/azuracast_web_v2
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
cache: ${{ github.event_name != 'schedule' }}