Unify GH actions.
This commit is contained in:
parent
2d6c9d4f1b
commit
31cce0f8d9
|
@ -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
|
|
@ -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' }}
|
Loading…
Reference in New Issue