Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,39 @@ on:
push:
branches:
- main
tags:
- '[0-9.]+'
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read

jobs:
build-docker-image:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
if: ${{ github.event_name == 'push' }}
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
push: ${{ github.event_name == 'push' }}
tags: |
${{ github.event_name == 'pull_request' && 'telefonicaiot/fiware-data-access:ci' || github.ref == 'refs/heads/main' && 'telefonicaiot/fiware-data-access:latest' || '' }}
${{ startsWith(github.ref, 'refs/tags/') && format('telefonicaiot/fiware-data-access:{0}', github.ref_name) || '' }}

lint-dockerfile:
name: Lint Dockerfile
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions doc/01_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ The Dockerfile used is located at:
docker/Dockerfile
```

The GitHub Actions build workflow publishes `telefonicaiot/fiware-data-access:latest` on pushes to `main` and publishes
the matching version tag for tags consisting only of digits and dots (the Docker Hub pattern `^[0-9.]+$`). Pull requests
build the image without publishing it. Publishing requires the repository secrets `DOCKER_HUB_USERNAME` and
`DOCKER_HUB_TOKEN`.

---

## 7. Verify the setup with tests
Expand Down
Loading