This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (53 loc) · 1.66 KB
/
build_push_service.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
48
49
50
51
52
53
54
55
56
57
58
59
---
name: Build and push Docker Image
on:
push:
branches-ignore:
- main
- master
- dependabot/*
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker meta Service Name
id: docker_meta_img
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch,enable=false,priority=600
type=sha,enable=true,priority=600,prefix=
- name: Log into registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_DOCKER_USERNAME }}
password: ${{ secrets.GHCR_DOCKER_TOKEN }}
- name: Build and push ${{ github.repository }}
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
labels: ${{ steps.docker_meta_img.outputs.labels }}
dispatch:
runs-on: ubuntu-latest
needs:
- build_and_push
steps:
- uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: hpi-schul-cloud/dof_app_deploy
event-type: dev-deploy
client-payload: '{"branch": "${{ steps.extract_branch.outputs.branch}}" }'