From ed182e381011bb78fcb00a42398ceed6f2148ac3 Mon Sep 17 00:00:00 2001 From: Lee Garam Date: Fri, 2 Feb 2024 15:47:02 +0900 Subject: [PATCH] Try to apply .env to docker --- .github/workflows/main.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b04b410..dcbec29 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,21 +18,16 @@ jobs: runs-on: ubuntu-latest needs: build # Continued from the build job steps: - # Because the .env file is not in the repository, we need to create it - # using the secrets.ENV_FILE secret - - name: Create env file - run: | - touch .env - echo "${{ secrets.ENV_FILE }}" > .env - pwd - ls -al . - name: Login to Dockerhub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and release to DockerHub - uses: docker/build-push-action@v2 - with: - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/goanonpicdb-aws:latest + # Because the .env file is not in the repository, we need to create it + # using the secrets.ENV_FILE secret + run: | + touch .env + echo "${{ secrets.ENV_FILE }}" > .env + docker build --tag "${{ secrets.DOCKERHUB_USERNAME }}/goanonpicdb-aws:latest" . + docker push "${{ secrets.DOCKERHUB_USERNAME }}/goanonpicdb-aws:latest" \ No newline at end of file