Update docker.yml

This commit is contained in:
Nobix
2022-04-08 05:13:32 +05:30
committed by GitHub
parent e98f84507f
commit 3805164bd4
+16 -16
View File
@@ -76,6 +76,22 @@ on:
required: false required: false
jobs: jobs:
laravel-tests:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.0'
- uses: actions/checkout@v3
- name: Copy app/code/
run: |
cd app/code
composer install
php artisan test
builtandtestimages: builtandtestimages:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -95,22 +111,6 @@ jobs:
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build docker image for test
uses: docker/build-push-action@v2
with:
context: app
load: true
tags: ${{ env.TEST_TAG }}
-
name: Test
run: |
apt-get install docker -y
docker run -d --name app ${{ env.TEST_TAG }}
docker exec -it app php artisan test
docker rm app -f
docker run --rm ${{ env.TEST_TAG }}
- -
name: Login to GHCR name: Login to GHCR
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'