Skip to content

Commit

Permalink
refactor(workflows): 🎉 update action workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhangunduz committed Dec 11, 2023
1 parent e3ef5aa commit 4e0d0c0
Show file tree
Hide file tree
Showing 11 changed files with 314 additions and 70 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/backup.yaml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/onpremise-amz-01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Image (onpremise-amz-01)

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
environment:
name: onpremise-amz-01

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

- name: Extract Version from package.json
id: project_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"

- name: Build the Docker Image
run: |
docker build \
--file Dockerfile \
--tag robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-amz-01 \
--build-arg REACT_APP_BACKEND_URL=${{ secrets.REACT_APP_BACKEND_URL }} \
--build-arg REACT_APP_KEYCLOAK_URL=${{ secrets.REACT_APP_KEYCLOAK_URL }} \
--build-arg REACT_APP_KEYCLOAK_REALM=${{ secrets.REACT_APP_KEYCLOAK_REALM }} \
--build-arg REACT_APP_KEYCLOAK_CLIENT_ID=${{ secrets.REACT_APP_KEYCLOAK_CLIENT_ID }} \
--build-arg REACT_APP_APPLICATION=${{ secrets.REACT_APP_APPLICATION }} \
--build-arg REACT_APP_CREATE_ORGANIZATION=${{ secrets.REACT_APP_CREATE_ORGANIZATION }} \
--build-arg REACT_APP_CREATE_REGION=${{ secrets.REACT_APP_CREATE_REGION }} \
--build-arg REACT_APP_CREATE_INSTANCE=${{ secrets.REACT_APP_CREATE_INSTANCE }} \
.
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push the Docker Image to Docker Hub
run: docker push robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-amz-01
41 changes: 41 additions & 0 deletions .github/workflows/onpremise-auto-01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Image (onpremise-auto-01)

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
environment:
name: onpremise-auto-01

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

- name: Extract Version from package.json
id: project_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"

- name: Build the Docker Image
run: |
docker build \
--file Dockerfile \
--tag robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-auto-01 \
--build-arg REACT_APP_BACKEND_URL=${{ secrets.REACT_APP_BACKEND_URL }} \
--build-arg REACT_APP_KEYCLOAK_URL=${{ secrets.REACT_APP_KEYCLOAK_URL }} \
--build-arg REACT_APP_KEYCLOAK_REALM=${{ secrets.REACT_APP_KEYCLOAK_REALM }} \
--build-arg REACT_APP_KEYCLOAK_CLIENT_ID=${{ secrets.REACT_APP_KEYCLOAK_CLIENT_ID }} \
--build-arg REACT_APP_APPLICATION=${{ secrets.REACT_APP_APPLICATION }} \
--build-arg REACT_APP_CREATE_ORGANIZATION=${{ secrets.REACT_APP_CREATE_ORGANIZATION }} \
--build-arg REACT_APP_CREATE_REGION=${{ secrets.REACT_APP_CREATE_REGION }} \
--build-arg REACT_APP_CREATE_INSTANCE=${{ secrets.REACT_APP_CREATE_INSTANCE }} \
.
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push the Docker Image to Docker Hub
run: docker push robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-auto-01
41 changes: 41 additions & 0 deletions .github/workflows/onpremise-auto-02.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Image (onpremise-auto-02)

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
environment:
name: onpremise-auto-02

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

- name: Extract Version from package.json
id: project_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"

- name: Build the Docker Image
run: |
docker build \
--file Dockerfile \
--tag robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-auto-02 \
--build-arg REACT_APP_BACKEND_URL=${{ secrets.REACT_APP_BACKEND_URL }} \
--build-arg REACT_APP_KEYCLOAK_URL=${{ secrets.REACT_APP_KEYCLOAK_URL }} \
--build-arg REACT_APP_KEYCLOAK_REALM=${{ secrets.REACT_APP_KEYCLOAK_REALM }} \
--build-arg REACT_APP_KEYCLOAK_CLIENT_ID=${{ secrets.REACT_APP_KEYCLOAK_CLIENT_ID }} \
--build-arg REACT_APP_APPLICATION=${{ secrets.REACT_APP_APPLICATION }} \
--build-arg REACT_APP_CREATE_ORGANIZATION=${{ secrets.REACT_APP_CREATE_ORGANIZATION }} \
--build-arg REACT_APP_CREATE_REGION=${{ secrets.REACT_APP_CREATE_REGION }} \
--build-arg REACT_APP_CREATE_INSTANCE=${{ secrets.REACT_APP_CREATE_INSTANCE }} \
.
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push the Docker Image to Docker Hub
run: docker push robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-auto-02
41 changes: 41 additions & 0 deletions .github/workflows/onpremise-def-01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Image (onpremise-def-01)

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
environment:
name: onpremise-def-01

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

- name: Extract Version from package.json
id: project_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"

- name: Build the Docker Image
run: |
docker build \
--file Dockerfile \
--tag robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-def-01 \
--build-arg REACT_APP_BACKEND_URL=${{ secrets.REACT_APP_BACKEND_URL }} \
--build-arg REACT_APP_KEYCLOAK_URL=${{ secrets.REACT_APP_KEYCLOAK_URL }} \
--build-arg REACT_APP_KEYCLOAK_REALM=${{ secrets.REACT_APP_KEYCLOAK_REALM }} \
--build-arg REACT_APP_KEYCLOAK_CLIENT_ID=${{ secrets.REACT_APP_KEYCLOAK_CLIENT_ID }} \
--build-arg REACT_APP_APPLICATION=${{ secrets.REACT_APP_APPLICATION }} \
--build-arg REACT_APP_CREATE_ORGANIZATION=${{ secrets.REACT_APP_CREATE_ORGANIZATION }} \
--build-arg REACT_APP_CREATE_REGION=${{ secrets.REACT_APP_CREATE_REGION }} \
--build-arg REACT_APP_CREATE_INSTANCE=${{ secrets.REACT_APP_CREATE_INSTANCE }} \
.
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push the Docker Image to Docker Hub
run: docker push robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-def-01
41 changes: 41 additions & 0 deletions .github/workflows/onpremise-hha-01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Image (onpremise-hha-01)

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
environment:
name: onpremise-hha-01

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

- name: Extract Version from package.json
id: project_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"

- name: Build the Docker Image
run: |
docker build \
--file Dockerfile \
--tag robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-hha-01 \
--build-arg REACT_APP_BACKEND_URL=${{ secrets.REACT_APP_BACKEND_URL }} \
--build-arg REACT_APP_KEYCLOAK_URL=${{ secrets.REACT_APP_KEYCLOAK_URL }} \
--build-arg REACT_APP_KEYCLOAK_REALM=${{ secrets.REACT_APP_KEYCLOAK_REALM }} \
--build-arg REACT_APP_KEYCLOAK_CLIENT_ID=${{ secrets.REACT_APP_KEYCLOAK_CLIENT_ID }} \
--build-arg REACT_APP_APPLICATION=${{ secrets.REACT_APP_APPLICATION }} \
--build-arg REACT_APP_CREATE_ORGANIZATION=${{ secrets.REACT_APP_CREATE_ORGANIZATION }} \
--build-arg REACT_APP_CREATE_REGION=${{ secrets.REACT_APP_CREATE_REGION }} \
--build-arg REACT_APP_CREATE_INSTANCE=${{ secrets.REACT_APP_CREATE_INSTANCE }} \
.
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push the Docker Image to Docker Hub
run: docker push robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-hha-01
41 changes: 41 additions & 0 deletions .github/workflows/onpremise-rl-01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Image (onpremise-rl-01)

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
environment:
name: onpremise-rl-01

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

- name: Extract Version from package.json
id: project_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"

- name: Build the Docker Image
run: |
docker build \
--file Dockerfile \
--tag robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-rl-01 \
--build-arg REACT_APP_BACKEND_URL=${{ secrets.REACT_APP_BACKEND_URL }} \
--build-arg REACT_APP_KEYCLOAK_URL=${{ secrets.REACT_APP_KEYCLOAK_URL }} \
--build-arg REACT_APP_KEYCLOAK_REALM=${{ secrets.REACT_APP_KEYCLOAK_REALM }} \
--build-arg REACT_APP_KEYCLOAK_CLIENT_ID=${{ secrets.REACT_APP_KEYCLOAK_CLIENT_ID }} \
--build-arg REACT_APP_APPLICATION=${{ secrets.REACT_APP_APPLICATION }} \
--build-arg REACT_APP_CREATE_ORGANIZATION=${{ secrets.REACT_APP_CREATE_ORGANIZATION }} \
--build-arg REACT_APP_CREATE_REGION=${{ secrets.REACT_APP_CREATE_REGION }} \
--build-arg REACT_APP_CREATE_INSTANCE=${{ secrets.REACT_APP_CREATE_INSTANCE }} \
.
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push the Docker Image to Docker Hub
run: docker push robolaunchio/frontend-onpremise:${{ steps.project_version.outputs.version }}-rl-01
41 changes: 41 additions & 0 deletions .github/workflows/public-demo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Image (public-demo)

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
environment:
name: public-demo

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

- name: Extract Version from package.json
id: project_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"

- name: Build the Docker Image
run: |
docker build \
--file Dockerfile \
--tag robolaunchio/frontend-public:${{ steps.project_version.outputs.version }}-demo \
--build-arg REACT_APP_BACKEND_URL=${{ secrets.REACT_APP_BACKEND_URL }} \
--build-arg REACT_APP_KEYCLOAK_URL=${{ secrets.REACT_APP_KEYCLOAK_URL }} \
--build-arg REACT_APP_KEYCLOAK_REALM=${{ secrets.REACT_APP_KEYCLOAK_REALM }} \
--build-arg REACT_APP_KEYCLOAK_CLIENT_ID=${{ secrets.REACT_APP_KEYCLOAK_CLIENT_ID }} \
--build-arg REACT_APP_APPLICATION=${{ secrets.REACT_APP_APPLICATION }} \
--build-arg REACT_APP_CREATE_ORGANIZATION=${{ secrets.REACT_APP_CREATE_ORGANIZATION }} \
--build-arg REACT_APP_CREATE_REGION=${{ secrets.REACT_APP_CREATE_REGION }} \
--build-arg REACT_APP_CREATE_INSTANCE=${{ secrets.REACT_APP_CREATE_INSTANCE }} \
.
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push the Docker Image to Docker Hub
run: docker push robolaunchio/frontend-public:${{ steps.project_version.outputs.version }}-demo
22 changes: 11 additions & 11 deletions .github/workflows/dev.yaml → .github/workflows/public-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: Docker Image (public-dev)

on:
push:
Expand All @@ -9,7 +9,7 @@ jobs:
build:
runs-on: ubuntu-latest
environment:
name: development
name: public-dev

steps:
- name: Checkout Code
Expand All @@ -22,16 +22,16 @@ jobs:
- name: Build the Docker Image
run: |
docker build \
--file Dockerfile-dev \
--file Dockerfile \
--tag robolaunchio/frontend-public:${{ steps.project_version.outputs.version }}-dev \
--build-arg REACT_APP_BACKEND_URL=${{ secrets.DEV_REACT_APP_BACKEND_URL }} \
--build-arg REACT_APP_KEYCLOAK_URL=${{ secrets.DEV_REACT_APP_KEYCLOAK_URL }} \
--build-arg REACT_APP_KEYCLOAK_REALM=${{ secrets.DEV_REACT_APP_KEYCLOAK_REALM }} \
--build-arg REACT_APP_KEYCLOAK_CLIENT_ID=${{ secrets.DEV_REACT_APP_KEYCLOAK_CLIENT_ID }} \
--build-arg REACT_APP_APPLICATION=${{ secrets.DEV_REACT_APP_APPLICATION }} \
--build-arg REACT_APP_CREATE_ORGANIZATION=${{ secrets.DEV_REACT_APP_CREATE_ORGANIZATION }} \
--build-arg REACT_APP_CREATE_REGION=${{ secrets.DEV_REACT_APP_CREATE_REGION }} \
--build-arg REACT_APP_CREATE_INSTANCE=${{ secrets.DEV_REACT_APP_CREATE_INSTANCE }} \
--build-arg REACT_APP_BACKEND_URL=${{ secrets.REACT_APP_BACKEND_URL }} \
--build-arg REACT_APP_KEYCLOAK_URL=${{ secrets.REACT_APP_KEYCLOAK_URL }} \
--build-arg REACT_APP_KEYCLOAK_REALM=${{ secrets.REACT_APP_KEYCLOAK_REALM }} \
--build-arg REACT_APP_KEYCLOAK_CLIENT_ID=${{ secrets.REACT_APP_KEYCLOAK_CLIENT_ID }} \
--build-arg REACT_APP_APPLICATION=${{ secrets.REACT_APP_APPLICATION }} \
--build-arg REACT_APP_CREATE_ORGANIZATION=${{ secrets.REACT_APP_CREATE_ORGANIZATION }} \
--build-arg REACT_APP_CREATE_REGION=${{ secrets.REACT_APP_CREATE_REGION }} \
--build-arg REACT_APP_CREATE_INSTANCE=${{ secrets.REACT_APP_CREATE_INSTANCE }} \
.
- name: Login to Docker Hub
Expand Down
27 changes: 16 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
FROM ubuntu:20.04
RUN apt-get update
RUN ln -fs /usr/share/zoneinfo/Europe/Istanbul /etc/localtime
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
RUN apt-get update && apt-get install -y wget curl vim mlocate apache2
RUN a2enmod rewrite
ADD build /var/www/html/
COPY .htaccess /var/www/html/.htaccess
COPY 000-default.conf /etc/apache2/sites-enabled/
RUN echo ServerName 127.0.0.1 >> /etc/apache2/apache2.conf
ENTRYPOINT ["apachectl", "-D", "FOREGROUND"]
FROM node:latest as build-stage
ARG REACT_APP_BACKEND_URL
ARG REACT_APP_KEYCLOAK_URL
ARG REACT_APP_KEYCLOAK_REALM
ARG REACT_APP_KEYCLOAK_CLIENT_ID
ARG REACT_APP_APPLICATION
ARG REACT_APP_CREATE_ORGANIZATION
ARG REACT_APP_CREATE_REGION
ARG REACT_APP_CREATE_INSTANCE
COPY . /app
WORKDIR /app
RUN npm install
RUN NODE_OPTIONS="--max-old-space-size=4096" npm run build
FROM nginx:alpine as production-stage
COPY --from=build-stage /app/build /usr/share/nginx/html
EXPOSE 80
Loading

0 comments on commit 4e0d0c0

Please sign in to comment.