forked from jaywink/matrix-alertmanager
-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (40 loc) · 1.22 KB
/
deploy.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Build and Deploy
on:
push:
env:
CI_REGISTRY_IMAGE: "${{ secrets.CI_REGISTRY }}/matrix-alertmanager"
jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.CI_REGISTRY }}
username: ${{ secrets.CI_REGISTRY_USER }}
password: ${{ secrets.CI_REGISTRY_PASSWORD }}
- name: Docker Build
uses: docker/build-push-action@v2
with:
cache-from: ${{ env.CI_REGISTRY_IMAGE }}:latest
pull: true
file: Dockerfile
tags: ${{ env.CI_REGISTRY_IMAGE }}:${{ github.sha }}
push: true
deploy-docker:
runs-on: ubuntu-latest
needs:
- build-docker
if: github.ref == 'refs/heads/beeper'
steps:
- name: Login to registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.CI_REGISTRY }}
username: ${{ secrets.CI_REGISTRY_USER }}
password: ${{ secrets.CI_REGISTRY_PASSWORD }}
- uses: beeper/docker-retag-push-latest@master
with:
image: ${{ env.CI_REGISTRY_IMAGE }}