-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (89 loc) · 4.21 KB
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Docker Image CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name : Build and push basicphp image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/dojo-basic
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker build . --file .shogun/Dockerfile.dojo-basic --tag dojo-basic
docker tag dojo-basic $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name : Build and push basicdb image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/dojo-basic-db
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker build . --file .shogun/Dockerfile.dojo-basic-db --tag dojo-basic-db
docker tag dojo-basic-db $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name : Build and push scavengerphp image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/dojo-scavenger
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker build . --file .shogun/Dockerfile.dojo-scavenger --tag dojo-scavenger
docker tag dojo-scavenger $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name : Build and push scavengerdb image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/dojo-scavenger-db
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker build . --file .shogun/Dockerfile.dojo-scavenger-db --tag dojo-scavenger-db
docker tag dojo-scavenger-db $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name : Build and push basicphp-lite image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/dojo-basic-lite
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker build . --file .shogun/Dockerfile.dojo-basic-lite --tag dojo-basic-lite
docker tag dojo-basic-lite $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name : Build and push scavanger-lite image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/dojo-scavenger-lite
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker build . --file .shogun/Dockerfile.dojo-scavenger-lite --tag dojo-scavenger-lite
docker tag dojo-scavenger-lite $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION