Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 55 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,31 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

Build-USFMParser-Image:
name: Build USFMParser image
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: FranzDiebold/github-env-vars-action@v2
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Build USFMParser image
uses: docker/build-push-action@v3
with:
context: ./dotnet/USFMParserApi
cache-from: type=gha
cache-to: type=gha,mode=max

Test-API-Image:
name: Test API image
runs-on: ubuntu-24.04
needs: Build-API-Image
needs: [Build-API-Image, Build-USFMParser-Image]
steps:
- uses: actions/checkout@v3
- uses: FranzDiebold/github-env-vars-action@v2
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Build API image with buildx
- name: Build local API image with buildx
uses: docker/build-push-action@v3
with:
context: .
Expand All @@ -53,35 +68,54 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build local USFMParser image with buildx
uses: docker/build-push-action@v3
with:
context: ./dotnet/USFMParserApi
tags: wycliffeassociates/doc-usfmparser:local
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Test API image with docker-compose
run: |
docker compose -f docker-compose.yml -f docker-compose.api-test.yml up --exit-code-from test-runner

Test-Frontend-Image:
name: Test Frontend image
runs-on: ubuntu-24.04
needs: [Build-API-Image, Build-Frontend-Image]
needs: [Build-API-Image, Build-Frontend-Image, Build-USFMParser-Image]
steps:
- uses: actions/checkout@v3
- uses: FranzDiebold/github-env-vars-action@v2
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Build api image
- name: Build local api image
uses: docker/build-push-action@v3
with:
context: .
tags: wycliffeassociates/doc:local
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build frontend image
- name: Build local frontend image
uses: docker/build-push-action@v3
with:
context: ./frontend
tags: wycliffeassociates/doc-ui:local
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build local USFMParser image with buildx
uses: docker/build-push-action@v3
with:
context: ./dotnet/USFMParserApi
tags: wycliffeassociates/doc-usfmparser:local
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build frontend-tests image
uses: docker/build-push-action@v3
with:
Expand Down Expand Up @@ -120,6 +154,11 @@ jobs:
echo "DOC_UI_TAG_SHA=wycliffeassociates/doc-ui:$GITHUB_SHA" >> $GITHUB_ENV && \
echo "DOC_UI_TAG_BRANCH=wycliffeassociates/doc-ui:$CI_REF_NAME_SLUG" >> $GITHUB_ENV && \
echo "DOC_UI_TAG_LATEST=wycliffeassociates/doc-ui:latest" >> $GITHUB_ENV
- name: Set DOC USFM parser tags
run: |
echo "DOC_PARSER_TAG_SHA=wycliffeassociates/doc-usfmparser:$GITHUB_SHA" >> $GITHUB_ENV && \
echo "DOC_PARSER_TAG_BRANCH=wycliffeassociates/doc-usfmparser:$CI_REF_NAME_SLUG" >> $GITHUB_ENV && \
echo "DOC_PARSER_TAG_LATEST=wycliffeassociates/doc-usfmparser:latest" >> $GITHUB_ENV

- name: Set version inside UI
run: |
Expand Down Expand Up @@ -152,6 +191,17 @@ jobs:
PUBLIC_DOC_BUILD_TIMESTAMP_ARG=${{ env.PUBLIC_DOC_BUILD_TIMESTAMP }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and conditional push Parser image
uses: docker/build-push-action@v3
with:
context: ./dotnet/USFMParserApi
push: true
tags: |
${{ env.DOC_PARSER_TAG_SHA }}
${{ env.DOC_PARSER_TAG_BRANCH }}
${{ env.DOC_PARSER_TAG_LATEST }}
cache-from: type=gha
cache-to: type=gha,mode=max
Deploy-develop:
name: Develop deploy on successful develop build
needs: [Push-Images]
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ services:
retries: 5
restart: unless-stopped
usfmparserapi:
build: ./dotnet/USFMParserApi
image: wycliffeassociates/doc-usfmparser:${IMAGE_TAG}
environment:
IMAGE_TAG: ${IMAGE_TAG:-local}
ports:
- ${DOTNET_API_PORT:-8081}:80
volumes:
Expand Down