Skip to content

Update node.js.yml

Update node.js.yml #13

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
# - run: npm test
- name: Checkout
uses: actions/checkout@v3
- name: Build Docker Image
id: buildAndPushImage
uses: MaximilianoBz/[email protected]
with:
registry_url: 'docker.io'
repository_name: 'cgdent/demo-app'
user_name: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
image_version: 'v1.0'
docker_file: '.'
- name: Get pre step result output image_pull_url
run: echo "The time was ${{ steps.buildAndPushImage.outputs.image_pull_url }}"