Skip to content

Commit

Permalink
Try to apply .env to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightChaser committed Feb 2, 2024
1 parent d6bcde5 commit ed182e3
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit ed182e3

Please sign in to comment.