-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.63 KB
/
package.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
name: Package (pre-release)
env:
GITHUB_SHA: ${{ github.sha }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/vospace
on:
push:
jobs:
package-docker:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Init - register short hash
run: echo SHA_SHORT="${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Init - register image tag
run: echo IMAGE_TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.SHA_SHORT }}" >> $GITHUB_ENV
- name: Build - build local ANT image
run: docker build -f Dockerfile.ApacheAnt -t apache-ant .
- name: Build - create VOSpace Java build with ANT
run: docker run --rm -v ./java:/app apache-ant dist
- name: Package - build VOSpace image
run: docker build --file Dockerfile --tag ${{ env.IMAGE_TAG }} .
- name: Test - Start VOSpace container
run: |
docker run -d \
--env-file .env.example \
--name vospace-example \
--port 3001:8080/tcp \
${{ env.IMAGE_TAG }}
- name: Test - perform health checks
run: |
curl \
--fail \
--connect-timeout 10 \
--retry 3 \
--retry-delay 5 \
--retry-max-time 40 \
--retry-all-errors \
-o /dev/null \
http://localhost:3001/vospace-2.0/vospace/
- name: Publish - Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish - Push the new tag
run: docker push ${{ env.IMAGE_TAG }}