jd-apprentice / jd-server

🖥️ Homelab
3 stars 0 forks source link

Find a way to create environment variables via pipeline #107

Open jd-apprentice opened 2 hours ago

jd-apprentice commented 2 hours ago

If i'm thinking in doing something like this to deploy everything that is inside docker and swarm

      - name: Setup docker standalone
        run: |
          echo "Copying docker files to ${{ inputs.node-name }} server"
          cp ansible/files/${{ inputs.node-name }}/docker/compose.standalone.yml ${{ env.NODE_DOCKER_PATH }}/compose.yml
          docker compose -f ${{ env.NODE_DOCKER_PATH }}/compose.yml up -d

      - name: Setup docker swarm
        run: |
          echo "Copying docker files to ${{ inputs.node-name }} server"
          cp ansible/files/${{ inputs.node-name }}/swarm/*.yml ${{ env.NODE_DOCKER_PATH }}/*.yml
          for file in ${{ env.NODE_DOCKER_PATH }}/*.yml; do
            file_name=$(cat $file | sed 's/compose\.//; s/\.yml//')
            docker stack deploy -c $file ${{ inputs.service }}
          done

I need to find a way to create envs for each of the applications.

jd-apprentice commented 2 hours ago

Some idea could be this, separe via branchs with https://github.com/jd-apprentice/jd-server/settings/environments/

And have a workflow like this

Image

jd-apprentice commented 2 hours ago

Image

Image