Skip to content

Commit

Permalink
feat: CI ready
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Jan 30, 2024
1 parent 7a76476 commit 0bb0a2c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
21 changes: 5 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,22 @@ jobs:
npx nx affected --target=test --parallel=3 --ci --code-coverage
npx nx affected --target=build --parallel=3
build-docker:
push-docker:
needs: lint-test-build
name: Build and upload docker image and archive
runs-on: ubuntu-latest

steps:
- name: Build datahub and produce archives
if: github.event_name == 'release'
run: |
npx nx run-many --projects=datahub --target=build
- uses: docker/login-action@v1
name: Login to GitHub Container Registry
with:
registry: ghcr.io
username: c2c-bot-gis-ci
password: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setting image tag
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

- name: "Pushing the image onto ghcr.io"
- name: 'Pushing the image onto ghcr.io'
run: |
docker image ls --format '{{.Repository}}:{{.Tag}}' --filter=reference='ghcr.io/camptocamp/mel-dataplatform/*' | \
xargs -r -L1 docker push $1
docker push ghcr.io/camptocamp/mel-dataplatform/datahub:latest
agents:
name: Nx Cloud - Agents
Expand Down
2 changes: 1 addition & 1 deletion apps/datahub/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"options": {
"commands": [
"nx build datahub --base-href='/datahub/'",
"docker build --build-arg APP_NAME=datahub -f ./tools/docker/Dockerfile . -t $(tools/print-docker-tag.sh datahub) -t ghcr.io/camptocamp/mel-dataplatform/datahub:latest"
"docker build --build-arg APP_NAME=datahub -f ./tools/docker/Dockerfile . -t ghcr.io/camptocamp/mel-dataplatform/datahub:latest"
],
"parallel": false
}
Expand Down
16 changes: 0 additions & 16 deletions tools/print-docker-tag.sh

This file was deleted.

0 comments on commit 0bb0a2c

Please sign in to comment.