-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (35 loc) · 1.39 KB
/
back.yml
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
name: Build and push Docker image with Kaniko
on:
push:
branches:
- 'feature-*'
paths:
- 'services/back/**'
- 'fakefile'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Set output
id: vars
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}
- name: Checkout repository
uses: actions/checkout@v2
- name: Docker login
uses: docker/login-action@v1
with:
registry: registry.inulogic.binboum.eu
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: services/back/
push: true
tags: registry.inulogic.binboum.eu/argo-test/back:${{ steps.vars.outputs.short_ref }}
- name: Get image digest
id: inspect-image
run: echo "::set-output name=digest::$(docker inspect --format='{{index .RepoDigests 0}}' registry.inulogic.binboum.eu/argo-test/back:${{ steps.vars.outputs.short_ref }} | cut -d'@' -f2)"
- name: REST API with curl
run: |
curl -X POST -H "Content-Type: application/json" -d '{"repo": "argo-test", "branch": "${{ steps.vars.outputs.short_ref }}", "serviceData": {"digestBack": "${{ steps.inspect-image.outputs.digest }}"}}' https://plugin.inulogic.binboum.eu/update