-
Notifications
You must be signed in to change notification settings - Fork 13
44 lines (36 loc) · 1.3 KB
/
publish-docker-image.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
name: Publish splunk-otel-js Docker image to ghcr.io
on:
release:
types: [published]
workflow_dispatch:
jobs:
publish-image:
runs-on: ubuntu-20.04
permissions:
packages: write
contents: read
steps:
- uses: actions/[email protected]
- uses: docker/setup-buildx-action@v2
- name: Put GITHUB_REF_NAME into env
run: echo GITHUB_REF_NAME=${GITHUB_REF_NAME} >> $GITHUB_ENV
- name: Set the major version number
run: echo MAJOR_VERSION=${GITHUB_REF_NAME} | sed -e 's/\..*//' >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and publish container
uses: docker/[email protected]
with:
push: true
file: Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
build-args: |
RELEASE_VER=${{ env.GITHUB_REF_NAME }}
tags: |
ghcr.io/signalfx/splunk-otel-js/splunk-otel-js:latest
ghcr.io/signalfx/splunk-otel-js/splunk-otel-js:${{ env.MAJOR_VERSION }}
ghcr.io/signalfx/splunk-otel-js/splunk-otel-js:${{ env.GITHUB_REF_NAME }}