-
Notifications
You must be signed in to change notification settings - Fork 69
47 lines (40 loc) · 1.37 KB
/
docker-nightly.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
37
38
39
40
41
42
43
44
45
46
47
name: Publish docker nightly
on:
push:
branches:
- "master"
jobs:
publish:
name: Publish images
runs-on: ubuntu-22.04
strategy:
matrix:
services: [api, checker, cli, notifier, filter]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
name: Login to DockerHub
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build docker tag
run: echo "DOCKER_TAG=$(echo $(date '+%Y-%m-%d').${GITHUB_SHA:0:7})" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v4
with:
file: ./Dockerfile.${{matrix.services}}
build-args: |
MoiraVersion=${{env.DOCKER_TAG}}
GIT_COMMIT=${{github.sha}}
push: true
tags: moira/${{matrix.services}}-nightly:${{env.DOCKER_TAG}},moira/${{matrix.services}}-nightly:latest
- name: Comment PR with build tag
uses: mshick/add-pr-comment@v2
if: always()
with:
refresh-message-position: true
message-success:
"Build and push Docker images with tag: ${{env.DOCKER_TAG}}"
message-failure:
"Builds images failed. See action log for details"