Skip to content
This repository was archived by the owner on Nov 4, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
62c44da
first commit
Sep 29, 2022
48d1c0a
convert to actions
rahulpatidar0191 Sep 29, 2022
a618d74
add .gitignore
rahulpatidar0191 Sep 29, 2022
584267c
remove modules
rahulpatidar0191 Sep 29, 2022
beb0d67
add action and shell script
rahulpatidar0191 Oct 9, 2022
353383d
remove uneeded files
rahulpatidar0191 Oct 9, 2022
55d2b51
make shell executable
rahulpatidar0191 Oct 9, 2022
5ad2dab
regenerate packages
rahulpatidar0191 Oct 9, 2022
1875381
add echo for each step
rahulpatidar0191 Oct 18, 2022
5b52db5
remove dev null part for now
rahulpatidar0191 Oct 19, 2022
2f1493e
turn off dev image check
rahulpatidar0191 Oct 19, 2022
fe67973
remove client
rahulpatidar0191 Oct 19, 2022
e15dcdb
make shell file executable
rahulpatidar0191 Oct 19, 2022
fab791e
modiy package json
rahulpatidar0191 Oct 19, 2022
f724b97
add docker down
rahulpatidar0191 Oct 19, 2022
4013495
add dockerfile option
rahulpatidar0191 Oct 19, 2022
3c0fdaa
Merge branch 'feature/webapp-deployment-1' of https://github.com/Sate…
rahulpatidar0191 Oct 19, 2022
9be68cc
move docker compose
rahulpatidar0191 Oct 19, 2022
9600501
move docker compose
rahulpatidar0191 Oct 19, 2022
186756a
move docker compose
rahulpatidar0191 Oct 19, 2022
f6522cc
move docker compose
rahulpatidar0191 Oct 19, 2022
8848555
add multiple registry and Dockerfile
rahulpatidar0191 Oct 25, 2022
620d3b5
exclude dev image check
rahulpatidar0191 Oct 25, 2022
3125d58
remove registry part
rahulpatidar0191 Oct 25, 2022
b506746
add registry and clean branch name
rahulpatidar0191 Oct 26, 2022
2c9578f
exclude app health check for now
rahulpatidar0191 Oct 26, 2022
5399254
remove tests
rahulpatidar0191 Oct 26, 2022
f131583
remove js
rahulpatidar0191 Nov 1, 2022
1343c8e
make shell exec
rahulpatidar0191 Nov 1, 2022
36d639a
add codeowners and update readme
rahulpatidar0191 Nov 2, 2022
aff73cf
fix typos
rahulpatidar0191 Nov 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .gitignore
Empty file.
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @rahulpatidar0191
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# satel-webapp-deployment
Centralized GitHub actions to deploy a webapp
# Satel Server Deployment
This centralized GitHub action deploys server for a webapp

## Usage
```yml
name: "Docker up"
on:
pull_request:
types:
- opened
push:
tags:
- "*"
branches:
- main

build-server:
name: Build server
needs: [generate-variables, build-client]
runs-on: <host_name>
steps:
- name: Build Docker
uses: SatelCreative/satel-server-deployment@feature/webapp-deployment-shell
with:
app-name: <app-name>
registry: ${{ steps.registry-push.outputs.registry }}
clean-branch-name: ${{ steps.registry-push.outputs.clean_branch_name }}
```

- `host_name` is `self-hosted` or the name of server where the action runner is hosted, `cosmicray` for example
- `app-name` can be `st-pim` or `sb-pim` for example and it's optional
- `registry` & `clean-branch-name` parameter is set in a previous step
19 changes: 19 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Satel-server-deployment
description: Deploys server side of webapp
inputs:
app-name:
description: Name of the Webapp
required: false
registry:
description: Provides current name of the registry
required: true
clean-branch-name:
description: Branch name that was pushed to registry
required: true

runs:
using: "composite"
steps:
- run: ${{ github.action_path }}/deploy_server.sh ${{ inputs.app-name }}
${{ inputs.registry }} ${{ inputs.clean-branch-name }} $
shell: bash
19 changes: 19 additions & 0 deletions deploy_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
APP_NAME=$1
REGISTRY=$2
CLEAN_BRANCH_NAME=$3

# Set registry and clean branch name as global variables
export REGISTRY=$REGISTRY
export CLEAN_BRANCH_NAME=$CLEAN_BRANCH_NAME

echo "Dev image check"
IMG_STR=`cat docker-compose.override.yml | grep 'devenv'| cut -d ":" -f 2-3`
IMG_LIST=( $IMG_STR ) #convert string into an array
for IMG in "${IMG_LIST[@]}"
do
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect ${IMG} > /dev/null || exit 1 # Check to see if the dev image is on registry or not
done

echo "Docker up"
docker-compose -f docker-compose.yml -f docker-compose.pipeline.yml up -d