Skip to content

Commit

Permalink
May I please log into the GH Container Registry 🙏
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua-Douglas committed Dec 19, 2023
1 parent 772bc0a commit 434524c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/CI-CD-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,46 @@ on:
required: true
default: false
jobs:
test-gh-repo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push API Image
run: |
IMAGE_NAME=ghcr.io/${{ github.repository }}/api:latest
docker build -t $IMAGE_NAME ./api
docker push $IMAGE_NAME
test-api-gh-repo:
runs-on: ubuntu-latest
needs: [test-gh-repo]
if: >-
github.event_name == 'push' ||
github.event.pull_request ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.test)
env:
COGNITO_REGION: ${{ secrets.COGNITO_REGION }}
COGNITO_ACCESS_ID: ${{ secrets.COGNITO_ACCESS_ID }}
COGNITO_ACCESS_KEY: ${{ secrets.COGNITO_ACCESS_KEY }}
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull API Image
run: docker pull ghcr.io/${{ github.repository }}/api:latest
- name: Run Debug Tests
run: docker run ghcr.io/${{ github.repository }}/api:latest pytest
- name: Run Release Tests
run: docker run --env COGNITO_REGION --env COGNITO_ACCESS_ID --env COGNITO_ACCESS_KEY ghcr.io/${{ github.repository }}/api:latest "pytest --mode=release"
build-api:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TODO: Run the openapi_server with nginx as reverse proxy and gunicorn as WSGI server
FROM python:3.10-alpine

RUN apk update && apk add build-base
RUN apk update && apk add build-base && apk add curl

RUN mkdir -p /opt/HomeUniteUs/api
WORKDIR /opt/HomeUniteUs/api
Expand Down

0 comments on commit 434524c

Please sign in to comment.