-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (44 loc) · 1.6 KB
/
build-and-publish.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
name: Build and Publish Container image
on:
push:
branches: [ otel ]
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
name: Build Container image
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build Docker image
uses: docker/build-push-action@v2
with:
context: .
push: false
push_to_registry:
runs-on: ubuntu-latest
name: Push container image to GitHub Packages
needs: build
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository_owner }}/co-http:${{ github.event.release.tag_name }}
labels: |
org.opencontainers.image.title=co-http
org.opencontainers.image.description=Simple workload for testing performance and optimization
org.opencontainers.image.url=github://github.com/${{ github.repository }}/releases/tag/${{ github.event.release.tag_name }}