Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit b57bc21

Browse files
Start migration to GH container repo 🦆
1 parent b851a47 commit b57bc21

File tree

1 file changed

+12
-49
lines changed

1 file changed

+12
-49
lines changed

.github/workflows/CI-CD-pipeline.yml

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
required: true
1818
default: false
1919
jobs:
20-
test-gh-repo:
20+
build-api:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v2
@@ -33,44 +33,6 @@ jobs:
3333
IMAGE_NAME=ghcr.io/hackforla/homeuniteus/api:latest
3434
docker build -t $IMAGE_NAME ./api
3535
docker push $IMAGE_NAME
36-
test-api-gh-repo:
37-
runs-on: ubuntu-latest
38-
needs: [test-gh-repo]
39-
if: >-
40-
github.event_name == 'push' ||
41-
github.event.pull_request ||
42-
(github.event_name == 'workflow_dispatch' && github.event.inputs.test)
43-
env:
44-
COGNITO_REGION: ${{ secrets.COGNITO_REGION }}
45-
COGNITO_ACCESS_ID: ${{ secrets.COGNITO_ACCESS_ID }}
46-
COGNITO_ACCESS_KEY: ${{ secrets.COGNITO_ACCESS_KEY }}
47-
steps:
48-
- name: Log in to GitHub Container Registry
49-
uses: docker/login-action@v1
50-
with:
51-
registry: ghcr.io
52-
username: ${{ github.actor }}
53-
password: ${{ secrets.GITHUB_TOKEN }}
54-
- name: Pull API Image
55-
run: docker pull ghcr.io/hackforla/homeuniteus/api:latest
56-
- name: Run Debug Tests
57-
run: docker run ghcr.io/hackforla/homeuniteus/api:latest pytest
58-
- name: Run Release Tests
59-
run: docker run --env COGNITO_REGION --env COGNITO_ACCESS_ID --env COGNITO_ACCESS_KEY ghcr.io/hackforla/homeuniteus/api:latest "pytest --mode=release"
60-
build-api:
61-
runs-on: ubuntu-latest
62-
steps:
63-
- uses: actions/checkout@v2
64-
- uses: docker/setup-buildx-action@v1
65-
- name: Build API Image
66-
run: |
67-
docker build -t api:latest ./api
68-
docker save api:latest -o api_image.tar
69-
- uses: actions/upload-artifact@v3
70-
with:
71-
name: api_image
72-
path: api_image.tar
73-
retention-days: 7
7436
build-app:
7537
runs-on: ubuntu-latest
7638
steps:
@@ -106,17 +68,18 @@ jobs:
10668
COGNITO_ACCESS_ID: ${{ secrets.COGNITO_ACCESS_ID }}
10769
COGNITO_ACCESS_KEY: ${{ secrets.COGNITO_ACCESS_KEY }}
10870
steps:
109-
- name: Download API Image Artifact
110-
uses: actions/download-artifact@v3
71+
- name: Log in to GitHub Container Registry
72+
uses: docker/login-action@v1
11173
with:
112-
name: api_image
113-
path: .
114-
- name: Load API Image
115-
run: docker load -i api_image.tar
74+
registry: ghcr.io
75+
username: ${{ github.actor }}
76+
password: ${{ secrets.GITHUB_TOKEN }}
77+
- name: Pull API Image
78+
run: docker pull ghcr.io/hackforla/homeuniteus/api:latest
11679
- name: Run Debug Tests
117-
run: docker run api:latest pytest
80+
run: docker run ghcr.io/hackforla/homeuniteus/api:latest pytest
11881
- name: Run Release Tests
119-
run: docker run --env COGNITO_REGION --env COGNITO_ACCESS_ID --env COGNITO_ACCESS_KEY api:latest "pytest --mode=release"
82+
run: docker run --env COGNITO_REGION --env COGNITO_ACCESS_ID --env COGNITO_ACCESS_KEY ghcr.io/hackforla/homeuniteus/api:latest "pytest --mode=release"
12083
test-app:
12184
runs-on: ubuntu-latest
12285
needs: [build-app, build-api]
@@ -145,8 +108,8 @@ jobs:
145108
docker run --network huu-test-network -d --name backend --env ENV='development' --env HOST=0.0.0.0 api:latest
146109
docker run --network huu-test-network -d --name frontend_nomock --env VITE_HUU_API_BASE_URL=http://backend:api app:latest-test "npx vite --host"
147110
sleep 10
148-
docker exec backend curl http://localhost:8080/api/auth/signup/host -H "accept: application/json" -H "Content-Type: application/json" -d "{\"email\": \"[email protected]\", \"password\": \"alskdf454$Adfa\"}"
149-
docker run --network huu-test-network --name cypress_tests_nomock --env CYPRESS_BASE_URL="http://frontend_nomock:4040" --env CYPRESS_USE_MOCK=false --env CYPRESS_REAL_EMAIL='[email protected]' --env CYPRESS_REAL_PASSWORD='alskdf454$Adfa' app:latest-test "npx cypress run"
111+
docker exec backend curl http://localhost:8080/api/auth/signup/host -H "accept: application/json" -H "Content-Type: application/json" -d "{\"email\": \"[email protected]\", \"password\": \"alskdf454#Adfa\"}"
112+
docker run --network huu-test-network --name cypress_tests_nomock --env CYPRESS_BASE_URL="http://frontend_nomock:4040" --env CYPRESS_USE_MOCK=false --env CYPRESS_REAL_EMAIL='[email protected]' --env CYPRESS_REAL_PASSWORD='alskdf454#Adfa' app:latest-test "npx cypress run"
150113
- name: Wait for Test to Complete
151114
run: |
152115
while true; do

0 commit comments

Comments
 (0)