Skip to content

Commit

Permalink
ci: push docker image (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleythedeveloper authored Aug 6, 2024
1 parent 226a621 commit 8aed15c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 16 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: package

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: docker meta details
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{github.repository}}
flavor: |
latest=auto
tags: |
type=edge,branch=next
type=semver,pattern={{version}}
type=sha
- name: Set up Docker
uses: docker/setup-buildx-action@v3

- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Release
uses: docker/build-push-action@v5
with:
push: ${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/next' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
15 changes: 0 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
FROM node:18-alpine

# Set the default values for the build arguments
ARG API_VERSION=v1
ARG PROTOCOL=http
ARG DOMAIN=localhost
ARG PORT=3333
ARG AVAILABLE_BUCKETS=verifiable-credentials,private-verifiable-credentials,epcis-events

# Set the environment variables
ENV API_VERSION=${API_VERSION}
ENV PROTOCOL=${PROTOCOL}
ENV DOMAIN=${DOMAIN}
ENV PORT=${PORT}
ENV AVAILABLE_BUCKETS=${AVAILABLE_BUCKETS}
ENV STORAGE_TYPE=${STORAGE_TYPE}

WORKDIR /app

COPY package*.json ./
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ yarn test
# Build the image
docker build -t storage-service:latest .

# Start the container
# Local Storage - Start the container
docker run -d --env-file .env storage-service:latest

# Cloud Storage - Start the container
docker run -d --env-file .env -p 3333:3333 \
-v path/to/local/gcp/service-account-file.json:/tmp/service-account-file.json \
storage-service:latest
Expand Down

0 comments on commit 8aed15c

Please sign in to comment.