From 6dc354439cb9fe22bff30a2724b71b2f96dae536 Mon Sep 17 00:00:00 2001 From: KantaNakamura <0706363@gmail.com> Date: Fri, 16 Jun 2023 09:22:15 +0800 Subject: [PATCH] rafactor test.yml --- .github/workflows/test.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8cbffb..ac62e72 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,17 +10,27 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set a environment variable + env: + SECRET_KEY: ${{ secrets.SECRET_KEY }} + DEBUG: ${{ secrets.DEBUG }} + DATABASE_ENGINE: ${{ secrets.DATABASE_ENGINE }} + DATABASE_NAME: ${{ secrets.DATABASE_NAME }} + DATABASE_USER: ${{ secrets.DATABASE_USER }} + DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} + DATABASE_HOST: ${{ secrets.DATABASE_HOST }} + DATABASE_PORT: ${{ secrets.DATABASE_PORT }} - name: Create .env file run: | touch .env - echo "SECRET_KEY=${{ secrets.SECRET_KEY }}" >> .env - echo "DEBUG=${{ secrets.DEBUG }}" >> .env - echo "DATABASE_ENGINE=${{ secrets.DATABASE_ENGINE }}" >> .env - echo "DATABASE_NAME=${{ secrets.DATABASE_NAME }}" >> .env - echo "DATABASE_USER=${{ secrets.DATABASE_USER }}" >> .env - echo "DATABASE_PASSWORD=${{ secrets.DATABASE_PASSWORD }}" >> .env - echo "DATABASE_HOST=${{ secrets.DATABASE_HOST }}" >> .env - echo "DATABASE_PORT=${{ secrets.DATABASE_PORT }}" >> .env + echo "SECRET_KEY=$SECRET_KEY" >> .env + echo "DEBUG=$DEBUG" >> .env + echo "DATABASE_ENGINE=$DATABASE_ENGINE" >> .env + echo "DATABASE_NAME=$DATABASE_NAME" >> .env + echo "DATABASE_USER=$DATABASE_USER" >> .env + echo "DATABASE_PASSWORD=$DATABASE_PASSWORD" >> .env + echo "DATABASE_HOST=$DATABASE_HOST" >> .env + echo "DATABASE_PORT=$DATABASE_PORT" >> .env - name: Checkout repository uses: actions/checkout@v2 - name: Excute tests