Skip to content

Commit

Permalink
1.7.3: Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
CorySanin committed Jan 28, 2024
1 parent 8748280 commit b416e56
Show file tree
Hide file tree
Showing 4 changed files with 761 additions and 757 deletions.
125 changes: 78 additions & 47 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: Docker Image CI
name: MultiArchDockerBuild

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches:
- master
tags:
- 'v*'

jobs:

build:
build_multi_arch_image:
name: Build multi-arch Docker image.
runs-on: ubuntu-latest
env:
DH_REGISTRY: docker.io
Expand All @@ -21,48 +22,78 @@ jobs:
packages: write

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Login to DockerHub
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v2
with:
registry: ${{ env.DH_REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.GH_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for release Docker image
if: startsWith(github.ref, 'refs/tags/v')
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ env.DOCKER_USERNAME }}/${{ env.REPOSITORY }}
${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Extract metadata for develop Docker image
if: "!startsWith(github.ref, 'refs/tags/v')"
id: meta-develop
uses: docker/metadata-action@v3
with:
images: |
${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: ${{ env.DH_REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push release Docker image
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v4
with:
target: deploy
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.GH_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: string
name: Prepare GitHub Docker image name
uses: ASzc/change-string-case-action@v5
with:
string: ${{ env.IMAGE_NAME }}

- name: Build and push
if: ${{ github.ref == 'refs/heads/master' }}
uses: docker/build-push-action@v4
with:
target: deploy
push: true
tags: |
${{ env.DOCKER_USERNAME }}/${{ env.REPOSITORY }}:latest
${{ env.GH_REGISTRY }}/${{ steps.string.outputs.lowercase }}:latest
platforms: linux/amd64,linux/arm64,linux/arm/v7
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}

- name: Build and push develop Docker image
if: "!startsWith(github.ref, 'refs/tags/v')"
uses: docker/build-push-action@v4
with:
target: deploy
push: true
tags: ${{ steps.meta-develop.outputs.tags }}
labels: ${{ steps.meta-develop.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
FROM node:lts-alpine3.18 AS install
FROM node:lts-alpine3.19 AS install

WORKDIR /usr/src/app

COPY package*.json ./

ENV NPM_CONFIG_LOGLEVEL warn
RUN npm ci --only=production || (\
apk add --no-cache make g++ && \
apk add --no-cache vips-cpp vips-dev --repository https://dl-cdn.alpinelinux.org/alpine/edge/community/ && \
apk add --no-cache make g++ vips-cpp vips-dev && \
npm install -g node-gyp && \
npm ci --only=production --build-from-source )

COPY . .

FROM node:lts-alpine3.18 AS deploy
FROM node:lts-alpine3.19 AS deploy

HEALTHCHECK --timeout=3s \
CMD curl --fail http://localhost:8081/healthcheck || exit 1

WORKDIR /usr/src/app

RUN apk add --no-cache curl && \
apk add --no-cache vips --repository https://dl-cdn.alpinelinux.org/alpine/edge/community/
RUN apk add --no-cache curl vips

COPY --from=install /usr/src/app /usr/src/app/

Expand Down

0 comments on commit b416e56

Please sign in to comment.