Skip to content

Commit

Permalink
GitHub workflow that builds a multi-platform Docker image and pushes …
Browse files Browse the repository at this point in the history
…it to Docker Hub
  • Loading branch information
namedgraph committed Jan 14, 2025
1 parent e2ad895 commit a7ac2e6
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: ci

on:
push:
tags:
- '*'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract version parts
id: version
run: |
VERSION="${{ github.ref_name }}"
MAJOR="${VERSION%%.*}"
MINOR="${VERSION%.*}"
MINOR="${MINOR#*.}"
echo "MAJOR=$MAJOR" >> $GITHUB_ENV
echo "MINOR=$MAJOR.$MINOR" >> $GITHUB_ENV
echo "FULL_VERSION=$VERSION" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
atomgraph/linkeddatahub:latest
atomgraph/linkeddatahub:${{ env.FULL_VERSION }}
atomgraph/linkeddatahub:${{ env.MINOR }}
atomgraph/linkeddatahub:${{ env.MAJOR }}

0 comments on commit a7ac2e6

Please sign in to comment.