Skip to content

Merge Develop in Main #19

Merge Develop in Main

Merge Develop in Main #19

Workflow file for this run

name: CI Pipeline | Build Docker Image
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build_and_push_docker_image:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y curl
sudo curl -L "https://github.com/docker/compose/releases/download/v2.21.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
- name: Login to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build the Docker images
run: docker-compose build
- name: Tag and push the Docker images
run: |
docker tag cscc01-linkup_frontend:latest ${{ secrets.DOCKERHUB_USERNAME }}/cscc01-linkup_frontend:latest
docker tag cscc01-linkup_backend:latest ${{ secrets.DOCKERHUB_USERNAME }}/cscc01-linkup_backend:latest
docker push ${{ secrets.DOCKERHUB_USERNAME }}/cscc01-linkup_frontend:latest
docker push ${{ secrets.DOCKERHUB_USERNAME }}/cscc01-linkup_backend:latest
- name: List Docker images
run: docker images