Skip to content

docker path to docker-compose #9

docker path to docker-compose

docker path to docker-compose #9

Workflow file for this run

name: CICD
on:
push:
branches:
- cicd
jobs:
publish:
runs-on:
ubuntu-latest
steps:
## Step 1: Configuration

Check failure on line 13 in .github/workflows/cicd.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/cicd.yml

Invalid workflow file

You have an error in your yaml syntax on line 13
- uses: actions/checkout@v3
- uses: s4u/[email protected]
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
## Step 2: Docker Login and Image Build
- name: Login to docker
run: docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" -p "${{ secrets.DOCKERHUB_TOKEN }}"
- name: Build the docker image
run: docker build -t "${{ secrets.DOCKERHUB_USERNAME }}"/"${{ secrets.DOCKERHUB_IMAGE }}" -f docker/Dockerfile .
## Step 3: Image Execution and Wait to Image Start
## Step 3: Instalar Docker Compose
- name: Install docker-compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version # Verifica que docker-compose se haya instalado correctamente
-name: Change path
run: cd docker
- name: Setup docker compose
run: docker-compose up -d
- name: Give permissions to wait containers start script
run: chmod +x waitContainers.sh
- name: Wait for containers to start
run: ./waitContainers.sh
## Step 4: Test execution
- name: Run tests
run: mvn clean test -Dtest=LoginUiTests.java
## Step 5: End Image Execution and Push image to Docker Hub
- name: Stop docker compose
run: docker-compose down
- name: Push the docker image
run: docker push ${{ secrets.DOCKERHUB_IMAGE }}
- name: Push the docker image
run: docker push ${{ secrets.DOCKERHUB_IMAGE }}