Skip to content

Install packages, actions updates #1

Install packages, actions updates

Install packages, actions updates #1

Workflow file for this run

name: Build web container
on:
push:
branches:
- main
paths:
- 'web/**'
- '.github/workflows/web.yml'
pull_request:
branches:
- main
paths:
- 'web/**'
- '.github/workflows/web.yml'
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
build:
needs: test
if: github.ref == 'refs/heads/main'
env:
IMAGE: ghcr.io/openinframap/web
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: ./web
file: ./web/Dockerfile.prod
push: true
tags: |
${{ env.IMAGE }}:${{ github.sha }}-${{ github.run_number }}