Skip to content

Commit

Permalink
Merge pull request #12 from geoblocks/fix-ci
Browse files Browse the repository at this point in the history
fix(ci): repair publish docker workflow
  • Loading branch information
gberaudo authored Oct 24, 2024
2 parents c9905a0 + d1940e0 commit 63c3216
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/publish_docker.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
name: Publish docker image

on:
workflow_run:
workflows: ['CI']
branches: [main]
branches: [master]
types:
- completed

Expand All @@ -25,16 +26,19 @@ jobs:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: DOCKER_REGISTRY
registry: ${DOCKER_REGISTRY}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push ngv
uses: docker/build-push-action@v6
with:
push: true
tags: ${DOCKER_REGISTRY}/${DOCKER_IMG_NAME:${DOCKER_TAG}
tags: ${DOCKER_REGISTRY}/${DOCKER_IMG_NAME}:${DOCKER_TAG}
- name: Update images sha
run: echo "img_sha=$(docker inspect --format='{{index .RepoDigests 0}}' '${DOCKER_REGISTRY}/${DOCKER_IMG_NAME}:${DOCKER_TAG}' | cut -d':' -f2)" >> $GITHUB_ENV;
id: get_image_sha
run: echo "img_sha=$(docker inspect --format='{{index .RepoDigests 0}}' '${DOCKER_REGISTRY}/${DOCKER_IMG_NAME}:${DOCKER_TAG}' | cut -d':' -f2)" >> $GITHUB_OUTPUT;
outputs:
image_sha: ${{ steps.get_image_sha.outputs.img_sha }}

trigger_deploy:
name: Trigger deploy on lab
Expand All @@ -53,7 +57,6 @@ jobs:
workflow_id: 'update-ngv-image.yaml',
ref: 'main'
inputs: {
environment: prod
img_sha: $img_sha
img_sha: ${{ needs.build_and_publish.outputs.img_sha }}
}
});
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ RUN npm run build # && npm run doc
FROM nginxinc/nginx-unprivileged:1.27-bookworm-perl AS server

LABEL org.opencontainers.image.source="https://github.com/geoblocks/ngv"
LABEL org.opencontainers.image.url="https://github.com/geoblocks/ngv"
LABEL org.opencontainers.image.title="ngv-ui"
LABEL org.opencontainers.image.description="UI container for the Modern 3D viewer"
LABEL org.opencontainers.image.version=""
LABEL org.opencontainers.image.licenses=""
LABEL org.opencontainers.image.revision=""
LABEL maintainer="Guillaume Beraudo <[email protected]>"

COPY --from=builder /app/dist /usr/share/nginx/html

# The nginx.conf.template file is used to configure the nginx server.
# The .conf.template files are used to configure the nginx server.
# In the entrypoint, the environment variables are automatically replaced.
# See docs for more information: https://hub.docker.com/_/nginx
COPY docker/*.conf.template /etc/nginx/templates/
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
services:
viewer:
image: ghcr.io/geoblocks/ngv-ui
build:
context: .
env_file: .env
Expand Down

0 comments on commit 63c3216

Please sign in to comment.