diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 093af5b1..8b2e7334 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -4,8 +4,6 @@ on: push: branches: - master - release: - types: [published] jobs: python: @@ -40,7 +38,7 @@ jobs: git push working-directory: ./website - docker: + docker_nightly: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -58,21 +56,12 @@ jobs: username: ${{github.actor}} password: ${{secrets.GITHUB_TOKEN}} - - name: Generate image ID and version - run: | - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/oxigraph - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # 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 + - uses: docker/metadata-action@v3 + id: docker_meta + with: + images: ghcr.io/${{ github.repository_owner }}/oxigraph + tags: nightly - # Cache: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache - name: Build and publish Docker image uses: docker/build-push-action@v2 with: @@ -80,6 +69,8 @@ jobs: file: ./server/Dockerfile builder: ${{ steps.buildx.outputs.name }} 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-to: type=gha,mode=max + # Docs about caching: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8978a65b..ae8f1ffb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,12 +14,21 @@ jobs: - uses: docker/metadata-action@v3 id: docker_meta with: - images: oxigraph/oxigraph + images: | + oxigraph/oxigraph + ghcr.io/${{ github.repository }} - uses: docker/setup-buildx-action@v1 - - uses: docker/login-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} 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 with: context: . diff --git a/server/README.md b/server/README.md index 112c46c0..1cd37f44 100644 --- a/server/README.md +++ b/server/README.md @@ -135,7 +135,7 @@ Then a `docker-compose.yml` in the same folder, you can change the default user version: "3" services: oxigraph: - image: ghcr.io/oxigraph/oxigraph + image: ghcr.io/oxigraph/oxigraph:latest ## To build from local source code: # build: # context: . @@ -163,7 +163,7 @@ Once the `docker-compose.yaml` and `nginx.conf` are ready, start the Oxigraph se 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 curl -X POST -u $OXIGRAPH_USER:$OXIGRAPH_PASSWORD -H 'Content-Type: application/sparql-update' --data 'INSERT DATA { }' http://localhost:7878/update