Skip to content

Commit 24bafd5

Browse files
authored
publish to docker hub via github actions (#1621)
1 parent c06c23d commit 24bafd5

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,55 @@ jobs:
4545
- run: npm install -g solid-server-*.tgz
4646
# Run the Solid test-suite
4747
- run: bash test/surface/run-solid-test-suite.sh $BRANCH_NAME
48+
49+
# TODO: The pipeline should automate publication to npm, so that the docker build gets the correct version
50+
# This job will only dockerize solid-server@latest / solid-server@<tag-name> from npmjs.com!
51+
docker-hub:
52+
needs: build
53+
name: Publish to docker hub
54+
if: github.event_name != 'pull_request'
55+
runs-on: ubuntu-latest
56+
steps:
57+
58+
- uses: actions/checkout@v2
59+
60+
- name: Lint dockerfile
61+
working-directory: docker-image
62+
run: pwd && ls -lah && make lint
63+
64+
- name: Run tests
65+
working-directory: docker-image
66+
run: make test
67+
68+
- name: Set up QEMU
69+
uses: docker/setup-qemu-action@v1
70+
71+
- name: Set up Docker Buildx
72+
uses: docker/setup-buildx-action@v1
73+
74+
- uses: olegtarasov/get-tag@v2.1
75+
id: tagName
76+
with:
77+
tagRegex: "(?<version>.*)"
78+
79+
- name: Docker meta
80+
id: meta
81+
uses: docker/metadata-action@v3
82+
with:
83+
images: nodesolidserver/node-solid-server
84+
85+
- name: Login to DockerHub
86+
uses: docker/login-action@v1
87+
with:
88+
username: ${{ secrets.DOCKERHUB_USERNAME }}
89+
password: ${{ secrets.DOCKERHUB_TOKEN }}
90+
91+
- name: Build and push
92+
id: docker_build
93+
uses: docker/build-push-action@v2
94+
with:
95+
context: ./docker-image/src
96+
build-args: SOLID_SERVER_VERSION=${{ steps.tagName.outputs.version }}
97+
push: true
98+
tags: ${{ steps.meta.outputs.tags }}
99+
labels: ${{ steps.meta.outputs.labels }}

docker-image/src/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM node:10-alpine
22

3+
# hadolint ignore=DL3018
34
RUN apk add --no-cache openssl
45

56
ARG SOLID_SERVER_VERSION=latest

0 commit comments

Comments
 (0)