Skip to content
This repository was archived by the owner on Mar 12, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Docker Build and Test

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

# add docker hub secrets
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: "mohamedelhabib"
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build Docker image
# build the image with the Dockerfile in the current directory and tag it with the git tag
run: docker build . --file Dockerfile --tag mohamedelhabib/docker-ajv:$GITHUB_REF_NAME
- name: Push Docker image
run: docker push mohamedelhabib/docker-ajv:$GITHUB_REF_NAME
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM node:8-alpine

ARG AJV_CLI_VERSION=3.2.1
RUN npm install -g ajv-cli@${AJV_CLI_VERSION}
FROM node:24.4.1-alpine3.22

ARG AJV_CLI_VERSION=5.0.0
ARG AJV_FORMATS_VERSION=3.0.1
RUN npm install -g ajv-cli@${AJV_CLI_VERSION} \
&& npm install -g ajv-formats@${AJV_FORMATS_VERSION}
VOLUME ["/data"]
WORKDIR "/data"

Expand Down