-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.16 KB
/
pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Pipeline
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
Build-Stage:
runs-on: ubuntu-latest
steps:
#Base checkout action repo
- uses: actions/checkout@v2
# Scan the code with sonar Cloud
- name: Sonar Cloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
args: |
-Dsonar.organization=doublest-github
-Dsonar.projectKey=doublest_RESTfulBlogApp
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Build Docker Image from Dockerfile
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
# Push to Harbor Demo
- name: Push to Harbor Demo
uses: opspresso/action-docker@master
with:
args: --docker
env:
USERNAME: ${{ secrets.HARBOR_USER }}
PASSWORD: ${{ secrets.HARBOR_PASSWORD }}
REGISTRY: "demo.goharbor.io"
DOCKERFILE: "Dockerfile"
IMAGE_NAME: "stieber-gha/restfulblogapp"
TAG_NAME: "v0.0.1"
LATEST: "true"