Move docker push to gh registry to release.yml. Every push to master are now published as nightly tag. Improved readme instructions for curl with authentication

pull/186/head
Vincent Emonet 3 years ago committed by Thomas Tanon
parent b97e358001
commit cf64633a11
  1. 27
      .github/workflows/doc.yml
  2. 13
      .github/workflows/release.yml
  3. 4
      server/README.md

@ -4,8 +4,6 @@ on:
push: push:
branches: branches:
- master - master
release:
types: [published]
jobs: jobs:
python: python:
@ -40,7 +38,7 @@ jobs:
git push git push
working-directory: ./website working-directory: ./website
docker: docker_nightly:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -58,21 +56,12 @@ jobs:
username: ${{github.actor}} username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}} password: ${{secrets.GITHUB_TOKEN}}
- name: Generate image ID and version - uses: docker/metadata-action@v3
run: | id: docker_meta
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/oxigraph with:
# Change all uppercase to lowercase images: ghcr.io/${{ github.repository_owner }}/oxigraph
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') tags: nightly
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo "IMAGE_ID=$IMAGE_ID" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_ENV
# Cache: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache
- name: Build and publish Docker image - name: Build and publish Docker image
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
@ -80,6 +69,8 @@ jobs:
file: ./server/Dockerfile file: ./server/Dockerfile
builder: ${{ steps.buildx.outputs.name }} builder: ${{ steps.buildx.outputs.name }}
push: true push: true
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }} tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
# Docs about caching: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache

@ -14,12 +14,21 @@ jobs:
- uses: docker/metadata-action@v3 - uses: docker/metadata-action@v3
id: docker_meta id: docker_meta
with: with:
images: oxigraph/oxigraph images: |
oxigraph/oxigraph
ghcr.io/${{ github.repository }}
- uses: docker/setup-buildx-action@v1 - uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1 - name: Login to DockerHub
uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- uses: docker/build-push-action@v2 - uses: docker/build-push-action@v2
with: with:
context: . context: .

@ -135,7 +135,7 @@ Then a `docker-compose.yml` in the same folder, you can change the default user
version: "3" version: "3"
services: services:
oxigraph: oxigraph:
image: ghcr.io/oxigraph/oxigraph image: ghcr.io/oxigraph/oxigraph:latest
## To build from local source code: ## To build from local source code:
# build: # build:
# context: . # context: .
@ -163,7 +163,7 @@ Once the `docker-compose.yaml` and `nginx.conf` are ready, start the Oxigraph se
docker-compose up docker-compose up
``` ```
To make an update to the graph, first change `$OXIGRAPH_USER` and `$OXIGRAPH_PASSWORD`, or set the environment variables, then run: Then it is possible to update the graph using basic authentication mechanisms. For example with `curl`: change `$OXIGRAPH_USER` and `$OXIGRAPH_PASSWORD`, or set them as environment variables, then run this command to insert a simple triple:
```sh ```sh
curl -X POST -u $OXIGRAPH_USER:$OXIGRAPH_PASSWORD -H 'Content-Type: application/sparql-update' --data 'INSERT DATA { <http://example.com/s> <http://example.com/p> <http://example.com/o> }' http://localhost:7878/update curl -X POST -u $OXIGRAPH_USER:$OXIGRAPH_PASSWORD -H 'Content-Type: application/sparql-update' --data 'INSERT DATA { <http://example.com/s> <http://example.com/p> <http://example.com/o> }' http://localhost:7878/update

Loading…
Cancel
Save