-
Notifications
You must be signed in to change notification settings - Fork 33
59 lines (51 loc) · 1.63 KB
/
container.yaml
File metadata and controls
59 lines (51 loc) · 1.63 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
49
50
51
52
53
54
55
56
57
58
59
name: build container
on:
push:
branches:
# make binaries which may be ahead of releases to use in CI jobs
- "canary*"
- "ci-bins*"
tags: # run this also on release candidates
- "[0-9]+.[0-9]+.[0-9]*"
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
publish:
permissions: write-all
name: container-build
# Note: builds only Intel container at present
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/libra-node
tags: |
# tag as git sha
type=sha,enable=true,priority=100,prefix=,suffix=,format=long
# tag canary releases
type=raw,value=canary,enable=${{contains(env.BRANCH_NAME, 'canary')}}
# tag ci bins releases
type=raw,value=ci-bins,enable=${{contains(env.BRANCH_NAME, 'ci-bins')}}
# tag version
type=semver,pattern={{version}}
- name: Log in to Container Image Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./container/Containerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
CI_COMMIT_SHA=${{ github.sha }}