Skip to content

Commit 040ee83

Browse files
authored
Merge pull request #52 from PerfectFit-project/issue172_design_deployment_process
Add actions to build the rasa server, rasa actions and scheduler images. These are tagged and pushed to ghcr upon pushes to main.
2 parents 5b04aad + 1424a0a commit 040ee83

File tree

7 files changed

+103
-0
lines changed

7 files changed

+103
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and publish the specified image at the given path
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
imagename:
7+
required: true
8+
type: string
9+
context:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
docker_publish:
15+
runs-on: "ubuntu-20.04"
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Build docker image
20+
run: |
21+
cd ${{ inputs.context }}
22+
docker build . -t ${{ inputs.imagename }} --tag ${{ inputs.imagename }} --label "runnumber=${GITHUB_RUN_ID}" -f Dockerfile
23+
- name: Log in to registry
24+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
25+
- name: Push image
26+
run: |
27+
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/${{ inputs.imagename }}
28+
29+
# Change all uppercase to lowercase
30+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
31+
# Strip git ref prefix from version
32+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
33+
# Strip "v" prefix from tag name
34+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
35+
# Use Docker `latest` tag convention
36+
[ "$VERSION" == "main" ] && VERSION=latest
37+
echo IMAGE_ID=$IMAGE_ID
38+
echo VERSION=$VERSION
39+
docker tag ${{ inputs.imagename }} $IMAGE_ID:$VERSION
40+
docker push $IMAGE_ID:$VERSION
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build and publish the rasa_actions image to ghcr.io
2+
3+
on:
4+
push:
5+
# Publish `main` as Docker `latest` image.
6+
branches:
7+
- main
8+
9+
# Publish `v1.2.3` tags as releases.
10+
tags:
11+
- v*
12+
13+
# Run tests for any PRs.
14+
pull_request:
15+
16+
jobs:
17+
publish_rasa_server:
18+
uses: ./.github/workflows/ghcr_build_and_push.yml
19+
with:
20+
imagename: rasa_actions
21+
context: Rasa_Bot/actions/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build and publish the rasa_server image to ghcr.io
2+
3+
on:
4+
push:
5+
# Publish `main` as Docker `latest` image.
6+
branches:
7+
- main
8+
9+
# Publish `v1.2.3` tags as releases.
10+
tags:
11+
- v*
12+
13+
# Run tests for any PRs.
14+
pull_request:
15+
16+
jobs:
17+
publish_rasa_server:
18+
uses: ./.github/workflows/ghcr_build_and_push.yml
19+
with:
20+
imagename: rasa_server
21+
context: Rasa_Bot/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build and publish the scheduler image to ghcr.io
2+
3+
on:
4+
push:
5+
# Publish `main` as Docker `latest` image.
6+
branches:
7+
- main
8+
9+
# Publish `v1.2.3` tags as releases.
10+
tags:
11+
- v*
12+
13+
# Run tests for any PRs.
14+
pull_request:
15+
16+
jobs:
17+
publish_rasa_server:
18+
uses: ./.github/workflows/ghcr_build_and_push.yml
19+
with:
20+
imagename: scheduler
21+
context: scheduler/

0 commit comments

Comments
 (0)