-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (39 loc) · 1.46 KB
/
release.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: Build and Publish Docker
on:
push:
branches:
- support-4.4
- support-4.3
jobs:
build_and_push:
runs-on: ubuntu-latest
env:
IMAGE_NAME: midpoint-builder
steps:
- name: checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Image Tag
id: prep
run: |
BASE_IMAGE_TAG=`grep "ARG BASE_IMAGE_TAG" Dockerfile | cut -d "=" -f 2 | sed "s/^v//" | head -n 1`
RELEASE_REVISION=`grep "ARG RELEASE_REVISION" Dockerfile | cut -d "=" -f 2`
IMAGE_TAG=${BASE_IMAGE_TAG}-${RELEASE_REVISION}
FULL_IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}
echo "Building $FULL_IMAGE_NAME:$IMAGE_TAG"
echo ::set-output name=name::${FULL_IMAGE_NAME}
echo ::set-output name=tag::${IMAGE_TAG}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.prep.outputs.name }}:${{ steps.prep.outputs.tag }}
cache-from: type=registry,ref=${{ steps.prep.outputs.name }}:support-4.4
cache-to: type=registry,ref=${{ steps.prep.outputs.name }}:support-4.4,mode=max