Skip to content

Merge pull request #1 from icatproject/api_creation #13

Merge pull request #1 from icatproject/api_creation

Merge pull request #1 from icatproject/api_creation #13

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- '*'
jobs:
Test:
runs-on: ubuntu-latest
steps:
# Checkout code
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Build and run ICAT Docker Compose stack
run: docker compose up -d opensearch seed_opensearch scigateway-auth
# Build and run tests
- name: Build and Test
run: |
docker build --target test -t search-api:test .
docker run --network search_api_default search-api:test
Push-to-Harbor:
needs: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Harbor
uses: docker/login-action@v3
with:
registry: ${{ secrets.HARBOR_URL }}
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: Build and push the Upload API Docker image
uses: docker/build-push-action@v6
with:
push: true
target: production
# Push to harbor using the branch name as tag.
tags: ${{ secrets.HARBOR_URL }}:${{ github.ref_name }}