42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
build-test:
|
|
runs-on: docker
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.14.0
|
|
cache: npm
|
|
|
|
- name: Install deps
|
|
run: npm ci
|
|
|
|
- name: Test
|
|
run: npm run test -- --passWithNoTests
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Login Registry
|
|
if: github.event_name == 'push'
|
|
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ secrets.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USER }} --password-stdin
|
|
|
|
- name: Build & Push CI Image
|
|
if: github.event_name == 'push'
|
|
env:
|
|
IMAGE: ${{ secrets.REGISTRY_URL }}/${{ secrets.IMAGE_NAME }}
|
|
run: |
|
|
docker build --build-arg NODE_VERSION=22.14.0 -t $IMAGE:ci-${{ github.sha }} -t $IMAGE:ci-latest .
|
|
docker push $IMAGE:ci-${{ github.sha }}
|
|
docker push $IMAGE:ci-latest
|
|
|