-
Notifications
You must be signed in to change notification settings - Fork 34
66 lines (63 loc) · 1.99 KB
/
ci.yaml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: CI
on:
push:
branches:
- main
jobs:
code_quality_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: TrueBrain/actions-flake8@master
name: Linting
if: "true"
with:
path: ./src
- uses: hadolint/hadolint-action@v1.5.0
name: Docker Linting
with:
dockerfile: ./src/Dockerfile
- name: MD Linting
uses: actionshub/markdownlint@main
- name: Stay woke
uses: get-woke/woke-action@v0
with:
# Cause the check to fail on any broke rules
fail-on-error: true
Build_Push_Image:
runs-on: ubuntu-latest
needs: code_quality_checks
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Image Tag
run: |
# IMAGE_TAG=${{ secrets.MAJOR_VERSION }}.${{ secrets.MINOR_VERSION }}.${{ secrets.HF_VERSION }}-${{ github.run_number }}
IMAGE_TAG=${{ secrets.MAJOR_VERSION }}.${{ secrets.MINOR_VERSION }}.${{ secrets.HF_VERSION }}
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
echo $IMAGE_TAG > $GITHUB_WORKSPACE/IMAGE_TAG
- name: Build and Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: true
context: ./src
tags: ghcr.io/azure/gitops-connector:${{ env.IMAGE_TAG }}, ghcr.io/azure/gitops-connector:latest
- name: Upload Image Tags
uses: actions/upload-artifact@v2.2.2
with:
name: image_tags
path: ${{ github.workspace }}/IMAGE_TAG
- name: Upload Manifests Templates
uses: actions/upload-artifact@v2.2.2
with:
name: manifests
path: ${{ github.workspace }}/manifests