-
Notifications
You must be signed in to change notification settings - Fork 66
83 lines (74 loc) · 2.83 KB
/
sequencer_docker-publish.yml
File metadata and controls
83 lines (74 loc) · 2.83 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Sequencer-Docker-Publish
on:
workflow_dispatch:
push:
branches:
- main
- main-v*.*.* # e.g. main-v0.14.0
- v*.*.*-integration # e.g. v0.14.0-integration
tags:
- "v*.*.*"
- "APOLLO-*"
paths:
- ".github/workflows/sequencer_docker-publish.yml"
- "crates/**"
- "scripts/dependencies.sh"
- "scripts/install_build_tools.sh"
- "deployments/images/base/Dockerfile"
- "deployments/images/sequencer/Dockerfile"
permissions:
contents: read
packages: write
# On PR events, cancel existing CI runs on this same PR for this workflow.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
REGISTRY: ghcr.io
REPO_NAME: ${{ github.repository }}
RUSTFLAGS: "-D warnings -C link-arg=-fuse-ld=lld"
jobs:
docker-build-push:
runs-on: namespace-profile-small-ubuntu-24-04-amd64
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Login to a Docker registry except on PR
# https://github.com/docker/login-action
- name: Login to registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: true
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4.1.1
with:
images: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}/sequencer
tags: |
type=raw,enable=${{ startsWith(github.ref, 'refs/tags/') && 'true' || 'false' }},value={{tag}}
type=semver,pattern={{raw}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=pr
# set `dev` tag for the default branch (`main`).
type=raw,value=dev,enable={{is_default_branch}}
# set `dev-{{branch}}-{{sha}}` additional tag for the default branch (`main`).
type=raw,value=dev-{{branch}}{{tag}}-{{sha}},enable={{is_default_branch}}
type=raw,value={{branch}}{{tag}}-{{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v6.13.0
with:
context: .
file: deployments/images/sequencer/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BUILD_MODE=release