Skip to content

Commit

Permalink
Test CircleCI with ghcr container image
Browse files Browse the repository at this point in the history
  • Loading branch information
kks32 committed Jun 25, 2024
1 parent b6cea3e commit f9cb06d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 29 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.0
jobs:
gns:
docker:
- image: quay.io/geoelements/gns
- image: docker pull ghcr.io/geoelements/gns:config
steps:
- checkout
# GCC
Expand All @@ -17,7 +17,6 @@ jobs:
DATA_PATH="${TMP_DIR}/${DATASET_NAME}/dataset/"
MODEL_PATH="${TMP_DIR}/${DATASET_NAME}/models/"
ROLLOUT_PATH="${TMP_DIR}/${DATASET_NAME}/rollout/"
pip3 install -r requirements.txt
pytest test/
echo "Test paths: ${DATA_PATH} ${MODEL_PATH}"
ls
Expand Down
53 changes: 26 additions & 27 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ name: Build and Push to GHCR

on:
push:
branches: [ "config" ]
paths:
- 'requirements.txt'
- 'Dockerfile'
pull_request:
branches: [ "config" ]
paths:
- 'requirements.txt'
- 'Dockerfile'

env:
# This sets the registry to GitHub Container Registry
REGISTRY: ghcr.io
# This uses the GitHub repository name as the image name
IMAGE_NAME: ${{ github.repository }}

jobs:
Expand All @@ -20,29 +22,26 @@ jobs:
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
# This specifies GHCR as the registry
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
# This sets up the full image name for GHCR
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
# This flag ensures the image is pushed to the registry
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit f9cb06d

Please sign in to comment.