add release action + some more UT coverage #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: docker | |
on: | |
push: | |
branches: | |
- dev | |
- main | |
pull_request: | |
branches: | |
- dev | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.event.pull_request.number }} | |
cancel-in-progress: true | |
jobs: | |
build-docker-image: | |
name: Build and push Docker image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to Artifactory | |
if: ${{ github.event_name == 'push' }} | |
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: Docker build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: "infra/sidecar.Dockerfile" | |
push: ${{ github.event_name == 'push' }} | |
tags: splitio-docker.jfrog.io/${{ github.event.repository.name }}/sidecar:${{ github.sha }} | |
deploy: | |
name: Deploy to testing | |
if: ${{ github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
needs: build-docker-image | |
steps: | |
- name: Deploy to testing | |
run: | | |
curl --header "Content-Type: application/json" \ | |
--request PUT \ | |
--data '{ "service": "${{ github.event.repository.name }}", "environment": "testing", "tag": "${{ github.sha }}", "token": "${{ secrets.R2D2_SLACK_TOKEN_STAGE }}"}' \ | |
https://r2d2.split-stage.io/deployment |