-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (27 loc) · 1.01 KB
/
ci.yaml
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
name: Test and Release
on: [push, pull_request]
jobs:
test:
name: Run test suite
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build Docker Image
run: docker build -f Dockerfile-builder . --rm=false
release:
needs: [ test ]
name: Push image
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Build Docker Image
run: docker build -f Dockerfile-builder . --rm=false -t ghcr.io/thought-machine/prometheus-multiplexer-sidecar:"$SHORT_SHA"
- name: Push Docker Image to ghcr.io
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker push ghcr.io/thought-machine/prometheus-multiplexer-sidecar:"$SHORT_SHA"