Skip to content

Commit 7385edf

Browse files
tnagorraAdityaKhatri
authored andcommitted
chore(ci): Build docker images before-hand
1 parent 62b3f1a commit 7385edf

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.github/workflows/actions.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,28 @@ jobs:
4242
exit 1;
4343
}
4444
45+
- name: Decrypt Service Account Key File
46+
working-directory: ./
47+
run: |
48+
openssl enc -aes-256-cbc -d -K "$OPENSSL_KEY" -iv "$OPENSSL_IV" -in ci-mapswipe-firebase-adminsdk-80fzw-ebce84bd5b.json.enc -out mapswipe_workers/serviceAccountKey.json
49+
env:
50+
OPENSSL_PASSPHRASE: ${{ secrets.OPENSSL_PASSPHRASE }}
51+
OPENSSL_KEY: ${{ secrets.OPENSSL_KEY }}
52+
OPENSSL_IV: ${{ secrets.OPENSSL_IV }}
53+
54+
- name: Build docker images
55+
run: |
56+
# Create a mock file for wal-g setup
57+
touch postgres/serviceAccountKey.json
58+
docker compose build postgres firebase_deploy mapswipe_workers_creation django
59+
4560
- name: Setup Postgres Database Container
4661
env:
4762
POSTGRES_PASSWORD: postgres
4863
POSTGRES_USER: postgres
4964
POSTGRES_DB: postgres
5065
run: |
51-
# Create a mock file for wal-g setup
52-
touch postgres/serviceAccountKey.json
53-
docker compose up --build --detach postgres
66+
docker compose up --detach postgres
5467
for i in {1..5}; do docker compose exec -T postgres pg_isready && s=0 && break || s=$? && sleep 5; done; (docker compose logs postgres && exit $s)
5568
5669
- name: Deploy Firebase Rules and Functions
@@ -60,15 +73,6 @@ jobs:
6073
run: |
6174
docker compose run --rm firebase_deploy sh -c "firebase use $FIREBASE_DB && firebase deploy --token $FIREBASE_TOKEN --only database"
6275
63-
- name: Decrypt Service Account Key File
64-
working-directory: ./
65-
run: |
66-
openssl enc -aes-256-cbc -d -K "$OPENSSL_KEY" -iv "$OPENSSL_IV" -in ci-mapswipe-firebase-adminsdk-80fzw-ebce84bd5b.json.enc -out mapswipe_workers/serviceAccountKey.json
67-
env:
68-
OPENSSL_PASSPHRASE: ${{ secrets.OPENSSL_PASSPHRASE }}
69-
OPENSSL_KEY: ${{ secrets.OPENSSL_KEY }}
70-
OPENSSL_IV: ${{ secrets.OPENSSL_IV }}
71-
7276
- name: Run Tests
7377
working-directory: ./mapswipe_workers
7478
env:

django/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10-buster
1+
FROM python:3.10-bullseye
22

33
LABEL maintainer="Mapswipe info@mapswipe.org"
44

0 commit comments

Comments
 (0)