Update postgres-service.yml
This commit is contained in:
10
.github/workflows/postgres-service.yml
vendored
10
.github/workflows/postgres-service.yml
vendored
@@ -12,6 +12,8 @@ jobs:
|
|||||||
container-job:
|
container-job:
|
||||||
runs-on: ubuntu-latest
|
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:
|
container:
|
||||||
image: node:10.16-jessie
|
image: node:10.16-jessie
|
||||||
|
|
||||||
@@ -34,11 +36,13 @@ jobs:
|
|||||||
- run: node client.js
|
- run: node client.js
|
||||||
working-directory: ./postgres
|
working-directory: ./postgres
|
||||||
env:
|
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
|
# If we were running the job on the VM this would be localhost
|
||||||
POSTGRES_HOST: postgres
|
POSTGRES_HOST: postgres
|
||||||
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
|
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:
|
vm-job:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
@@ -62,7 +66,7 @@ jobs:
|
|||||||
- run: node client.js
|
- run: node client.js
|
||||||
working-directory: ./postgres
|
working-directory: ./postgres
|
||||||
env:
|
env:
|
||||||
# use postgres for the host here because we have specified a contaienr for the job.
|
# 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 localhost
|
# If we were running the job on the VM this would be postgres
|
||||||
POSTGRES_HOST: localhost
|
POSTGRES_HOST: localhost
|
||||||
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port
|
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port
|
||||||
|
|||||||
Reference in New Issue
Block a user