Skip to content

adds initial package and release workflows #1

adds initial package and release workflows

adds initial package and release workflows #1

Workflow file for this run

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 }}