Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/deploy-ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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
Loading