Open mauriciabad opened 1 year ago
Well, at the end I just didn't use this action and this this workflow:
Where DOCKER_HOST
looks like this: ssh://username@serverip
name: Deploy backend
on:
push:
branches: main
jobs:
deploy-backend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create backend .env file
run: echo "${{ secrets.BACKEND_PROD_ENV_FILE }}" > ./backend/.env
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.DOCKER_SSH_KNOWN_HOSTS }}
- name: Deploy to server
run: docker compose -f backend/docker-compose.yaml up -d
env:
DOCKER_HOST: ${{ secrets.DOCKER_HOST }}
I was expecting this action to do exactly the same as I did with this workflow, but somehow it does a different thing.
Hi, I'm having a problem using the action. I think that the environment variables are not being sent from the .env file to the remote server. I can't figure out how to send them. I'm new using Docker, maybe what I'm trying doesn't make sense.
I tried using the docker-compose
--env-file
option inside theargs
but it gives another error saying that the option is invalid. (See log 2)This is my GitHub actions workflow:
These are the error logs:
And this is my
docker-compose.yaml
:Log 2, for the error using
--env-vars