-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Sunbird-ALL/all-1.0-prod
Merging All 1.0 prod to Main
- Loading branch information
Showing
6 changed files
with
146 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: PROD DEPLOYMENT | ||
|
||
on: | ||
push: | ||
branches: [ all-1.0-prod ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- | ||
name: Load .env from GitHub Secret | ||
run: echo "${{ secrets.MY_ENV_VARS_PROD }}" > .env | ||
|
||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ secrets.CONTAINER_REGISTRY_PROD }}:${{ secrets.IMAGE_TAG }} | ||
env: | ||
MY_ENV_VARS: ${{ secrets.MY_ENV_VARS_PROD }} | ||
deploy: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
needs: [build] | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Deploy Stack | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST_PROD }} | ||
username: ${{ secrets.USERNAME_PROD }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY_PROD }} | ||
port: ${{ secrets.PORT }} | ||
script: | | ||
docker login | ||
docker container stop ${{ secrets.CONTAINER_NAME }} | ||
docker rm ${{ secrets.CONTAINER_NAME }} | ||
docker rmi ${{ secrets.CONTAINER_REGISTRY_PROD }}:${{ secrets.IMAGE_TAG }} | ||
docker pull ${{ secrets.CONTAINER_REGISTRY_PROD }}:${{ secrets.IMAGE_TAG }} | ||
docker run -d --name ${{ secrets.CONTAINER_NAME }} --network ${{ secrets.NETWORK }} -p ${{ secrets.CONTAINER_PORT }} -t ${{ secrets.CONTAINER_REGISTRY_PROD }}:${{ secrets.IMAGE_TAG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: DEV DEPLOYMENT | ||
|
||
on: | ||
push: | ||
branches: [ all-1.0 ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- | ||
name: Load .env from GitHub Secret | ||
run: echo "${{ secrets.MY_ENV_VARS }}" > .env | ||
|
||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ secrets.CONTAINER_REGISTRY }}:${{ secrets.IMAGE_TAG }} | ||
env: | ||
MY_ENV_VARS: ${{ secrets.MY_ENV_VARS }} | ||
deploy: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
needs: [build] | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Deploy Stack | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
port: ${{ secrets.PORT }} | ||
script: | | ||
docker login | ||
docker container stop ${{ secrets.CONTAINER_NAME }} | ||
docker rm ${{ secrets.CONTAINER_NAME }} | ||
docker rmi ${{ secrets.CONTAINER_REGISTRY }}:${{ secrets.IMAGE_TAG }} | ||
docker pull ${{ secrets.CONTAINER_REGISTRY }}:${{ secrets.IMAGE_TAG }} | ||
docker run -d --name ${{ secrets.CONTAINER_NAME }} --network ${{ secrets.NETWORK }} -p ${{ secrets.CONTAINER_PORT }} -t ${{ secrets.CONTAINER_REGISTRY }}:${{ secrets.IMAGE_TAG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# all-learner-text-eval | ||
# all-learner-text-eval. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters