Skip to content

Commit

Permalink
Add docker image release
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslawCzerwinski committed Dec 1, 2023
1 parent f1020d7 commit e4160ed
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release-docker-iamge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release workoutrecorder-frontend image
on:
workflow_dispatch:
inputs:
version:
description: 'App version to release'
required: true
default: '1.0.0'
fabioip:
description: 'Public fabio ip addres'
required: true

jobs:
release:
name: Release workoutrecorder-frontend
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set app version
run: |
version=${{ github.event.inputs.version }}
sed -i "s/<VERSION>/$version/g" frontend/package.json
- name: Set fabio public ip
run: |
fabioip=${{ github.event.inputs.fabioip }}
sed -i "s/<FABIO_PUBLIC_IP>/$fabioip/g" frontend/src/environments/environment.prod.ts
- name: Login to Github container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
tags: ghcr.io/red-devops/workoutrecorder-frontend:${{ github.event.inputs.version }}
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:16.1-alpine as build-step
RUN mkdir -p /app
WORKDIR /app
COPY frontend/package.json /app
RUN npm install
COPY ./frontend /app
RUN npm run build --prod

FROM nginx:1.17.1-alpine
COPY --from=build-step /app/dist/workoutrecorder-front /usr/share/nginx/html

0 comments on commit e4160ed

Please sign in to comment.