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 }}
0 commit comments