Skip to content

Commit

Permalink
Merge pull request #46 from wwWallet/new-workflows
Browse files Browse the repository at this point in the history
created docker file for base image, added workflows for base image and added hook for new release
  • Loading branch information
kkmanos authored May 27, 2024
2 parents cd2f8f9 + 61a6f27 commit bf189a2
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 6 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/docker-base-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build Docker image

on:
push:
branches-ignore:
- master
pull_request:

jobs:
build-base:
# Permissions for GITHUB_TOKEN
permissions:
contents: read # To check out repo
packages: read # To read NPM registry

uses: wwwallet/wallet-ecosystem/.github/workflows/docker-build-push.yml@master
secrets: inherit
with:
image-tag: ghcr.io/wwwallet/wallet-enterprise:base
docker-push: false
dockerfile-path: ./base.Dockerfile
22 changes: 22 additions & 0 deletions .github/workflows/docker-base-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Push Docker image
on:
push:
tags:
- v0.*
- v1.*
- v2.*


jobs:
push-base:
# Permissions for GITHUB_TOKEN
permissions:
contents: read # To check out repo
packages: write # To read NPM registry

uses: wwwallet/wallet-ecosystem/.github/workflows/docker-build-push.yml@master
secrets: inherit
with:
image-tag: ghcr.io/wwwallet/wallet-enterprise:base-${{ github.ref_name }}
docker-push: true
dockerfile-path: ./base.Dockerfile
2 changes: 2 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
packages: read # To read NPM registry

uses: wwwallet/wallet-ecosystem/.github/workflows/docker-build-push.yml@master
secrets: inherit
with:
image-tag: ghcr.io/wwwallet/wallet-enterprise:latest
docker-push: false
dockerfile-path: ./Dockerfile
14 changes: 9 additions & 5 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Build and push Docker image

name: Push Docker image
on:
push:
branches:
- master
tags:
- v0.*
- v1.*
- v2.*


jobs:
build:
Expand All @@ -14,6 +16,8 @@ jobs:
packages: write # To read NPM registry and push Docker image

uses: wwwallet/wallet-ecosystem/.github/workflows/docker-build-push.yml@master
secrets: inherit
with:
image-tag: ghcr.io/wwwallet/wallet-enterprise:latest
image-tag: ghcr.io/wwwallet/wallet-enterprise:${{ github.ref_name }}
docker-push: true
dockerfile-path: ./Dockerfile
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ COPY --from=builder /home/node/app/views ./views


RUN --mount=type=secret,id=npmrc,required=true,target=./.npmrc,uid=1000 \
yarn install --production
yarn cache clean && yarn install --production

ENV NODE_ENV production
EXPOSE 8003
Expand Down
5 changes: 5 additions & 0 deletions base.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM node:16-bullseye-slim

WORKDIR /app

COPY . .

0 comments on commit bf189a2

Please sign in to comment.