Repository navigation
51 lines (48 loc) · 1.75 KB
/
Copy pathdocker.yml
File metadata and controls
51 lines (48 loc) · 1.75 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
name: Docker
# The image of a release, for amd64 and arm64 (arm64 emulated: the build is small): pushed as the release's version,
# its minor and major versions and latest when a release tag (json2rdf-<version>) is pushed, or by hand for a tag given.
# Needs the repository variable DOCKERHUB_USERNAME and the secret DOCKERHUB_TOKEN, as LinkedDataHub's release.
on:
push:
tags: ['json2rdf-*']
workflow_dispatch:
inputs:
tag:
description: 'the release tag to build (json2rdf-<version>)'
required: true
env:
IMAGE: atomgraph/json2rdf
jobs:
image:
runs-on: ubuntu-latest
steps:
- name: The release's version
id: version
run: |
tag="${{ github.event.inputs.tag || github.ref_name }}"
version="${tag#json2rdf-}"
major="${version%%.*}"
minor="${version%.*}"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "minor=$minor" >> "$GITHUB_OUTPUT"
echo "major=$major" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
ref: ${{ steps.version.outputs.tag }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.IMAGE }}:${{ steps.version.outputs.version }}
${{ env.IMAGE }}:${{ steps.version.outputs.minor }}
${{ env.IMAGE }}:${{ steps.version.outputs.major }}
${{ env.IMAGE }}:latest