Skip to content

[MAIN-2312] Git action #4

[MAIN-2312] Git action

[MAIN-2312] Git action #4

Workflow file for this run

name: Release Robusta
on:
release:
types: [published]
pull_request:
types: [opened, synchronize, reopened]
env:
RELEASE_VER : "git-test-image" #${{ github.event.release.tag_name }}
jobs:
setup-build-publish-deploy:
if: github.event_name == 'release' || (github.event_name == 'pull_request')
name: Build images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up gcloud CLI
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
project_id: genuine-flight-317411
export_default_credentials: true
- name: Configure Docker
run: |-
gcloud auth configure-docker us-central1-docker.pkg.dev
- name: Verify gcloud configuration
run: |-
gcloud config get-value project
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
file: Dockerfile
context: .
platforms: linux/arm64,linux/amd64
push: true
tags: us-central1-docker.pkg.dev/genuine-flight-317411/devel/kubewatch:${{ env.RELEASE_VER }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker images Dockerhub
uses: docker/build-push-action@v2
with:
file: Dockerfile
context: .
platforms: linux/arm64,linux/amd64
push: true
tags: robustadev/kubewatch:${{ env.RELEASE_VER }}
# Upload helm chart only on release, not on pull request
- name: Upload helm chart
if: github.event_name == 'release'
run: |
cd helm && ./upload_chart.sh