From 8f3d6afff841d1e281eafaceb48bbcf6b7ea3c81 Mon Sep 17 00:00:00 2001 From: Liav Yona Date: Thu, 18 May 2023 14:16:31 +0300 Subject: [PATCH] add ci for docker image and helm --- .github/workflows/workflow.flytube.yml | 53 +++++++++++++++++++ .github/workflows/workflow.helm.yml | 31 +++++++++++ .gitignore | 2 +- {flytube-chart => charts}/flytube/.helmignore | 0 {flytube-chart => charts}/flytube/Chart.yaml | 0 .../flytube/templates/deployment.yaml | 0 .../flytube/templates/secret.yaml | 0 {flytube-chart => charts}/flytube/values.yaml | 0 {flytube-terraform => terraform}/main.tf | 0 {flytube-terraform => terraform}/providers.tf | 0 {flytube-terraform => terraform}/variables.tf | 0 11 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/workflow.flytube.yml create mode 100644 .github/workflows/workflow.helm.yml rename {flytube-chart => charts}/flytube/.helmignore (100%) rename {flytube-chart => charts}/flytube/Chart.yaml (100%) rename {flytube-chart => charts}/flytube/templates/deployment.yaml (100%) rename {flytube-chart => charts}/flytube/templates/secret.yaml (100%) rename {flytube-chart => charts}/flytube/values.yaml (100%) rename {flytube-terraform => terraform}/main.tf (100%) rename {flytube-terraform => terraform}/providers.tf (100%) rename {flytube-terraform => terraform}/variables.tf (100%) diff --git a/.github/workflows/workflow.flytube.yml b/.github/workflows/workflow.flytube.yml new file mode 100644 index 0000000..0c1008c --- /dev/null +++ b/.github/workflows/workflow.flytube.yml @@ -0,0 +1,53 @@ +name: Build Flytube Image +on: + workflow_dispatch: + inputs: + flytubetag: + description: 'Version Tag for the Flytube Docker Image' + required: true + default: '1.0.0' +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Get current time + uses: gerred/actions/current-time@master + id: current-time + + - name: Build and push image to prod + uses: docker/build-push-action@v2 + with: + push: true + tags: | + infralightio/flytube:${{ github.event.inputs.flytubetag }} + infralightio/flytube:latest + labels: | + org.opencontainers.image.created=${{ steps.current-time.outputs.time }} + org.opencontainers.image.authors=Infralight + org.opencontainers.image.revision=${{ github.sha }} + org.opencontainers.image.version=${{ github.event.inputs.flytubetag }} + + - name: Slack Notification + if: ${{ success() }} + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: ${{ job.status }} + SLACK_ICON: https://assets-global.website-files.com/5d514fd9493b0575f03520bd/5d8e0b39fd776a3c238e8753_icons8_infinity_large_filled_2.svg + SLACK_MESSAGE: "K8s Collector image pushed to infralightio/flytube:${{ github.event.inputs.flytubetag }}" + SLACK_TITLE: "K8s Collector image pushed to infralightio/flytube:${{ github.event.inputs.flytubetag }}" + SLACK_USERNAME: cicdBot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file diff --git a/.github/workflows/workflow.helm.yml b/.github/workflows/workflow.helm.yml new file mode 100644 index 0000000..e87bbd6 --- /dev/null +++ b/.github/workflows/workflow.helm.yml @@ -0,0 +1,31 @@ +name: Release Charts + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v1 + with: + version: v3.8.1 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.4.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.gitignore b/.gitignore index 6c4184b..62c8935 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -.idea/0 \ No newline at end of file +.idea/ \ No newline at end of file diff --git a/flytube-chart/flytube/.helmignore b/charts/flytube/.helmignore similarity index 100% rename from flytube-chart/flytube/.helmignore rename to charts/flytube/.helmignore diff --git a/flytube-chart/flytube/Chart.yaml b/charts/flytube/Chart.yaml similarity index 100% rename from flytube-chart/flytube/Chart.yaml rename to charts/flytube/Chart.yaml diff --git a/flytube-chart/flytube/templates/deployment.yaml b/charts/flytube/templates/deployment.yaml similarity index 100% rename from flytube-chart/flytube/templates/deployment.yaml rename to charts/flytube/templates/deployment.yaml diff --git a/flytube-chart/flytube/templates/secret.yaml b/charts/flytube/templates/secret.yaml similarity index 100% rename from flytube-chart/flytube/templates/secret.yaml rename to charts/flytube/templates/secret.yaml diff --git a/flytube-chart/flytube/values.yaml b/charts/flytube/values.yaml similarity index 100% rename from flytube-chart/flytube/values.yaml rename to charts/flytube/values.yaml diff --git a/flytube-terraform/main.tf b/terraform/main.tf similarity index 100% rename from flytube-terraform/main.tf rename to terraform/main.tf diff --git a/flytube-terraform/providers.tf b/terraform/providers.tf similarity index 100% rename from flytube-terraform/providers.tf rename to terraform/providers.tf diff --git a/flytube-terraform/variables.tf b/terraform/variables.tf similarity index 100% rename from flytube-terraform/variables.tf rename to terraform/variables.tf