Skip to content

Commit

Permalink
documented GHCR pull
Browse files Browse the repository at this point in the history
  • Loading branch information
abimichel committed Jan 26, 2024
1 parent aa8c55f commit 3872e42
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish-ods-dlh-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ "main" ]

env:
# Abi: image name is bcgov/nr-dbt-project/ods-dlh:main
# Abi: image name is ghcr.io/bcgov/nr-dbt-project-ods-dlh:main
REGISTRY: ghcr.io
DBT_PATH: ods_dlh_data_processing
IMAGE_NAME: ${{ github.repository }}-ods-dlh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# nr-dbt-project
This repository contains Data build tools(DBT) data models and other artifacts

# Docker Build Command
docker build -t image-registry.apps.emerald.devops.gov.bc.ca/a1b9b0-dev/<image_name>:<tag> -f <Dockerfile_Name> .
# Use of GHCR
Container images are built automatically and pushed to the GHCR any time there is a push or PR to the **main** branch. Images are named according to the file path and tagged with the branch name. Use the image name in an Airflow DAG to create a job using the DBT container. See Airflow example here: [dbt_example.py](https://github.com/bcgov/nr-airflow/blob/e45c83f933d1f96e479a36a3e765dabd61e1ff2e/dags/dbt_example.py#L19)

Usage example:
```sh
docker pull ghcr.io/bcgov/nr-dbt-project-ods-dlh:main
```

# Docker Push Command
Alternatively, there is this manual workflow:
```sh
docker build -t image-registry.apps.emerald.devops.gov.bc.ca/a1b9b0-dev/<image_name>:<tag> -f <Dockerfile_Name> .
```
```sh
docker push image-registry.apps.emerald.devops.gov.bc.ca/a1b9b0-dev/<image_name>:<tag>
```

0 comments on commit 3872e42

Please sign in to comment.