stages:-build-test-deploybuild_a: stage: build script:-echo"This job will run first."build_b: stage: build script:-echo"This job will run first, in parallel with build_a."test_ab: stage: test script:-echo"This job will run after build_a and build_b have finished."deploy_ab: stage: deploy script:-echo"This job will run after test_ab is complete"
jobs:build_a:runs-on:ubuntu-lateststeps:-run:echo"This job will be run first."build_b:runs-on:ubuntu-lateststeps:-run:echo"This job will be run first, in parallel with build_a"test_ab:runs-on:ubuntu-latestneeds: [build_a,build_b]
steps:-run:echo"This job will run after build_a and build_b have finished"deploy_ab:runs-on:ubuntu-latestneeds: [test_ab]
steps:-run:echo"This job will run after test_ab is complete"
container-job:variables:POSTGRES_PASSWORD:postgres# The hostname used to communicate with the# PostgreSQL service containerPOSTGRES_HOST:postgres# The default PostgreSQL portPOSTGRES_PORT:5432image:node:10.18-jessieservices:-postgresscript:# Performs a clean installation of all dependencies# in the `package.json` file-npmci# Runs a script that creates a PostgreSQL client,# populates the client with data, and retrieves data-nodeclient.jstags:-docker
jobs:container-job:runs-on:ubuntu-latestcontainer:node:10.18-jessieservices:postgres:image:postgresenv:POSTGRES_PASSWORD:postgressteps:-name:Checkoutrepositorycodeuses:actions/checkout@v3# Performs a clean installation of all dependencies# in the `package.json` file-name:Installdependenciesrun:npmci-name:ConnecttoPostgreSQL# Runs a script that creates a PostgreSQL client,# populates the client with data, and retrieves datarun:nodeclient.jsenv:# The hostname used to communicate with the# PostgreSQL service containerPOSTGRES_HOST:postgres# The default PostgreSQL portPOSTGRES_PORT:5432