Skip to content

Commit

Permalink
Update and rename CI\CD Pipeline to CI\CD Pipeline.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AbuMecca authored Aug 27, 2024
1 parent f8ad1b7 commit a4af51c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 21 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/CI\CD Pipeline

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/CI\CD Pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI/CD Pipeline
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
build:
runs-on: ubuntu-latest
needs: sonarcloud
steps:

- name: Checkout code
uses: actions/checkout@v2

- name: List files in the build context
run: ls -R /home/runner/work/IBM-Tasks/IBM-Tasks

- name: Set up minikube
uses: sagikazarmark/setup-minikube-action@v0

- name: Start Minikube
run: |
minikube start
- name: Set up Podman
run: |
sudo apt-get update
sudo apt-get install -y podman
- name: Build Docker image with Podman
run: |
podman build -t docker.io/amrhossam235/myapp:${{ github.sha }} .
- name: List Docker images
run: |
podman images
- name: Show Docker image details
run: |
podman inspect docker.io/amrhossam235/myapp:${{ github.sha }}
- name: Push Docker image to Docker Hub
run: |
echo $DOCKER_PASSWORD | podman login --username $DOCKER_USERNAME --password-stdin docker.io
podman push docker.io/amrhossam235/myapp:${{ github.sha }} docker://docker.io/amrhossam235/myapp:${{ github.sha }}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

0 comments on commit a4af51c

Please sign in to comment.