Skip to content

Merge pull request #246 from splitio/fix/wrong_segment_keys_on_init #46

Merge pull request #246 from splitio/fix/wrong_segment_keys_on_init

Merge pull request #246 from splitio/fix/wrong_segment_keys_on_init #46

Workflow file for this run

name: cd
on:
push:
branches:
- master
permissions:
contents: read
id-token: write
jobs:
build-test-deploy:
name: Build, run tests and Deploy to S3
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '^1.13.1'
- name: Get version
run: echo "VERSION=$(awk '/^const Version/{gsub(/"/, "", $4); print $4}' splitio/version.go)" >> $GITHUB_ENV
- name: Run test
run: make test_coverage
- name: Create build folder
run: mkdir -p build
- name: Execute build
run: make release_assets
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::825951051969:role/gha-downloads-role
aws-region: us-east-1
- name: Deploy to S3
run: aws s3 sync $SOURCE_DIR s3://$BUCKET
env:
BUCKET: downloads.split.io
SOURCE_DIR: ./build
- name: SonarQube Scan (Push)
uses: SonarSource/[email protected]
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
with:
projectBaseDir: .
args: >
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.projectVersion=${{ env.VERSION }}
push-docker-image:
name: Build and Push Docker Image
runs-on: ubuntu-latest
strategy:
matrix:
mode: [synchronizer, proxy]
steps:
- name: Login to Artifactory
uses: docker/login-action@v2
with:
registry: splitio-docker.jfrog.io
username: ${{ secrets.ARTIFACTORY_DOCKER_USER }}
password: ${{ secrets.ARTIFACTORY_DOCKER_PASS }}
- name: Checkout code
uses: actions/checkout@v3
- name: Get version
run: echo "VERSION=$(awk '/^const Version/{gsub(/"/, "", $4); print $4}' splitio/version.go)" >> $GITHUB_ENV
- name: Docker Build and Push
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile.${{ matrix.mode }}
push: true
tags: splitio-docker.jfrog.io/split-${{ matrix.mode }}:${{ env.VERSION }}