forked from star-bnl/star-sw
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (42 loc) · 1.54 KB
/
build-containers.yml
File metadata and controls
48 lines (42 loc) · 1.54 KB
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
name: Build Containers
on:
push:
branches:
- main
- 'SL*'
tags:
- '*'
jobs:
ROOT5:
if: github.repository_owner == 'star-bnl'
runs-on: ubuntu-latest
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v4.8
- 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.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Rebuild up to base-stage
uses: docker/build-push-action@v2
with:
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/star-sw-root5-base:cache
file: docker/Dockerfile.root5
target: base-stage
push: true
tags: ghcr.io/${{ github.repository_owner }}/star-sw-root5-base:${{ steps.branch-name.outputs.current_branch }}_latest
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/star-sw-root5-base:cache,mode=max
- name: Build release container
if: steps.branch-name.outputs.is_tag == 'true'
uses: docker/build-push-action@v2
with:
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/star-sw-root5-base:cache
file: docker/Dockerfile.root5
target: build-stage
push: true
tags: ghcr.io/${{ github.repository_owner }}/star-sw-root5-build:${{ steps.branch-name.outputs.tag }}