✨ [NFE-180] Adicionar Sentry Dsn nas variáveis de ambiente #57
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHP Dev | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
pull_request: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
PHP: [73, 74, 80, 81] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Prepare code | |
env: | |
PHP_VERSION: ${{ matrix.PHP }} | |
run: | | |
touch .env | |
echo "IMAGE=sistema-core-dev" >> .env | |
echo "VERSAO=${PHP_VERSION}-dev" >> .env | |
echo "PASTA_WWW=www${PHP_VERSION}" >> .env | |
- name: Run tests dev | |
env: | |
PHP_VERSION: ${{ matrix.PHP }} | |
run: | | |
docker-compose \ | |
--file docker-compose.yml \ | |
--file docker-compose-${PHP_VERSION}.yml \ | |
--file docker-compose.dev.yml \ | |
up --build -d | |
echo $(docker run -t --network lemp jwilder/dockerize \ | |
-wait http://core_nginx/ \ | |
-timeout 60s) | |
docker ps -a | |
docker logs app | |
CONTENT=$(curl -s "http://127.0.0.1/"); | |
APP_CONTENT=$(docker exec app app echo); | |
echo "CHAMADA HTTP: ${CONTENT}"; | |
echo "CHAMADA APP: ${APP_CONTENT}"; | |
if [ "${CONTENT}" != "core|${PHP_VERSION}" ]; then | |
echo "Chamada HTTP retornou errado: ${CONTENT}" | |
exit 1; | |
fi | |
if [ "${APP_CONTENT}" != "core|${PHP_VERSION}" ]; then | |
echo "Chamada APP retornou errado: ${APP_CONTENT}" | |
exit 1; | |
fi | |
docker-compose \ | |
--file docker-compose.yml \ | |
--file docker-compose-${PHP_VERSION}.yml \ | |
--file docker-compose.dev.yml \ | |
down -v | |
- name: Run tests prod | |
env: | |
PHP_VERSION: ${{ matrix.PHP }} | |
run: | | |
docker-compose \ | |
--file docker-compose.yml \ | |
--file docker-compose-${PHP_VERSION}.yml \ | |
--file docker-compose.dev.yml \ | |
--file docker-compose.prod.yml \ | |
up --build -d | |
echo $(docker run -t --network lemp jwilder/dockerize \ | |
-wait http://core_nginx/ \ | |
-timeout 60s) | |
docker ps -a | |
docker logs app | |
CONTENT=$(curl -s "http://127.0.0.1/"); | |
APP_CONTENT=$(docker exec app app echo); | |
echo "CHAMADA HTTP: ${CONTENT}"; | |
echo "CHAMADA APP: ${APP_CONTENT}"; | |
if [ "${CONTENT}" != "core|${PHP_VERSION}" ]; then | |
echo "Chamada HTTP retornou errado: ${CONTENT}" | |
exit 1; | |
fi | |
if [ "${APP_CONTENT}" != "core|${PHP_VERSION}" ]; then | |
echo "Chamada APP retornou errado: ${APP_CONTENT}" | |
exit 1; | |
fi | |
push: | |
needs: test | |
strategy: | |
matrix: | |
PHP: [73, 74, 80, 81] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# - name: Login to GitHub Container Registry | |
# uses: docker/login-action@v1 | |
# with: | |
# registry: ghcr.io | |
# username: ${{ github.repository_owner }} | |
# password: ${{ secrets.CR_PAT }} | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
build-args: | | |
VERSAO_PHP=likesistemas/php-dev:${{ matrix.PHP }} | |
push: true | |
tags: | | |
likesistemas/sistema-core-dev:${{ matrix.PHP }} | |
# ghcr.io/likesistemas/sistema-core-dev:${{ matrix.PHP }} |