Skip to content

Commit afc80bb

Browse files
authored
Add a "Build docker Image" Github action (#332)
1 parent fc59d4f commit afc80bb

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/docker-image.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Docker Buildx
14+
uses: docker/setup-buildx-action@v3
15+
- name: Login to GitHub Container Registry
16+
uses: docker/login-action@v3
17+
with:
18+
registry: ghcr.io
19+
username: ${{ github.actor }}
20+
password: ${{ secrets.GITHUB_TOKEN }}
21+
- name: Get commit ID
22+
id: vars
23+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
24+
- name: Build and push Docker image
25+
id: push
26+
uses: docker/build-push-action@v5
27+
with:
28+
context: .
29+
push: true
30+
platforms: linux/amd64
31+
tags: ghcr.io/diamondlightsource/dlstbx:latest,ghcr.io/diamondlightsource/dlstbx:${{ steps.vars.outputs.sha_short }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM harbor.diamond.ac.uk/dockerhub-cache/dials/dials:latest
1+
FROM dials/dials:latest
22

33
RUN yum install bzip2 libXxf86vm rrdtool git -y
44
RUN pip install patchelf

0 commit comments

Comments
 (0)