This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
generated from epics-containers/ec-phoebus
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 1.84 KB
/
buiild.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
60
name: Build and publish image to ghcr.io/epics-containers
on:
push:
pull_request:
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Determine container image tag to use
id: tag
run: |
# tag is branch name or tag if there is a tag
echo ::set-output name=image_tag::${GITHUB_REF##*/}
echo ::set-output name=do_push::true
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io/epics-containers
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build developer image
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
push: ${{ steps.tag.outputs.do_push }}
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.tag.outputs.image_tag }}
# - name: Build runtime image
# uses: docker/build-push-action@v5
# with:
# builder: ${{ steps.buildx.outputs.name }}
# push: ${{ steps.tag.outputs.do_push }}
# tags: |
# ghcr.io/${{ github.repository }}:${{ steps.tag.outputs.image_tag }}.run
# target: runtime
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache