diff --git a/.github/workflows/postgres-service.yml b/.github/workflows/postgres-service.yml index 4b91c7c..806f8e4 100644 --- a/.github/workflows/postgres-service.yml +++ b/.github/workflows/postgres-service.yml @@ -12,6 +12,8 @@ jobs: container-job: runs-on: ubuntu-latest + # runs all of the steps inside the specified continer rather than on the VM host. + # Because of this the network configuration changes from host based network to a container network. container: image: node:10.16-jessie @@ -34,11 +36,13 @@ jobs: - run: node client.js working-directory: ./postgres env: - # use postgres for the host here because we have specified a contaienr for the job. + # use postgres for the host here because we have specified a container for the job. # If we were running the job on the VM this would be localhost POSTGRES_HOST: postgres POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} +# Runs all steps on the VM +# The service containers will use host port binding instead of container networking so you access them via localhost rather than the service name vm-job: runs-on: ubuntu-latest @@ -62,7 +66,7 @@ jobs: - run: node client.js working-directory: ./postgres env: - # use postgres for the host here because we have specified a contaienr for the job. - # If we were running the job on the VM this would be localhost + # use localhost for the host here because we have specified a container for the job. + # If we were running the job on the VM this would be postgres POSTGRES_HOST: localhost POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port