Merge pull request #118 from spe-uob/feature/issue-104/docker-impleme… #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Deploy the Docker image to GHCR | |
| name: CD Deployment | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| - build-system-overhaul | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Checkout the repository | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| # Step 2: Set up Java 21 | |
| - name: Set up Java | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: 21 | |
| distribution: openjdk | |
| # Step 3: Build the JAR file with Maven | |
| - name: Build JAR | |
| run: mvn clean package | |
| # Step 4: Log in to GitHub Container Registry | |
| - name: Log in to GHCR | |
| run: echo "${{ secrets.CONTAINER_REGISTRY_PAT }}" | docker login ghcr.io -u GerardChabaBristol --password-stdin | |
| # Step 5: Build and push the Docker image | |
| - name: Publish Docker image to GHCR | |
| uses: docker/build-push-action@v3 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ghcr.io/spe-uob/2024-AILearningTool:latest |