Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
akdasa committed Jul 29, 2024
1 parent 5a3d372 commit bf9bb38
Showing 1 changed file with 36 additions and 25 deletions.
61 changes: 36 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ on:

env:
REGISTRY: ghcr.io
ORGANIZATION: akdasa-studios
VERSION: v0.1.0
# VERSION: ${{ github.event.release.tag_name }}

jobs:
#
# Build
# Stage 1: Build backend and staging mobile apps
#

build-backend:
Expand Down Expand Up @@ -51,18 +52,17 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push docker image
- name: Build Image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.config.context }}
# push: true
load: true
tags: |
ghcr.io/akdasa-studios/lectorium-${{ matrix.config.service }}:${{ env.VERSION }}-dev
${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-${{ matrix.config.service }}:${{ env.VERSION }}-dev
- name: push docker image
- name: Push Image
run: |
docker push ghcr.io/akdasa-studios/lectorium-${{ matrix.config.service }}:${{ env.VERSION }}-dev
docker push ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-${{ matrix.config.service }}:${{ env.VERSION }}-dev
build-mobile-staging:
name: Build / ${{ matrix.config.name }}
Expand All @@ -82,10 +82,13 @@ jobs:
steps:
- name: Build App
run: |
echo "Running E2E tests"
echo "Tests passed"
echo "Building ${{ matrix.config.name }} app"
#
# Stage 2: Deploy backend to staging
#

deploy-staging:
deploy-backend-staging:
name: Deploy / Staging
runs-on: ubuntu-latest
environment: Staging
Expand All @@ -105,15 +108,19 @@ jobs:
- name: Promote Images
run: |
for service in gateway database database-bootstrap; do
docker pull ghcr.io/akdasa-studios/lectorium-$service:${{ env.VERSION }}-dev
docker tag ghcr.io/akdasa-studios/lectorium-$service:${{ env.VERSION }}-dev ghcr.io/akdasa-studios/lectorium-$service:${{ env.VERSION }}-rc
docker push ghcr.io/akdasa-studios/lectorium-$service:${{ env.VERSION }}-rc
docker pull ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-$service:${{ env.VERSION }}-dev
docker tag ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-$service:${{ env.VERSION }}-dev ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-$service:${{ env.VERSION }}-rc
docker push ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-$service:${{ env.VERSION }}-rc
done
#
# Stage 3: Run E2E tests
#

tests-e2e:
name: E2E Tests
runs-on: ubuntu-latest
needs: [deploy-staging, build-mobile-staging]
needs: [deploy-backend-staging, build-mobile-staging]
permissions:
contents: read
packages: write
Expand All @@ -122,8 +129,10 @@ jobs:
- name: Run E2E Tests
run: |
echo "Running E2E tests"
echo "Tests passed"
#
# Stage 4: Build production mobile apps and deploy to production
#

build-mobile-production:
name: Build / ${{ matrix.config.name }}
Expand All @@ -144,10 +153,9 @@ jobs:
steps:
- name: Build App
run: |
echo "Running E2E tests"
echo "Tests passed"
echo "Building ${{ matrix.config.name }} app"
deploy-production:
deploy-backend-production:
name: Deploy / Production
runs-on: ubuntu-latest
environment: Production
Expand All @@ -167,17 +175,21 @@ jobs:
- name: Promote Images
run: |
for service in gateway database database-bootstrap; do
docker pull ghcr.io/akdasa-studios/lectorium-$service:${{ env.VERSION }}-rc
docker tag ghcr.io/akdasa-studios/lectorium-$service:${{ env.VERSION }}-rc ghcr.io/akdasa-studios/lectorium-$service:${{ env.VERSION }}
docker tag ghcr.io/akdasa-studios/lectorium-$service:${{ env.VERSION }}-rc ghcr.io/akdasa-studios/lectorium-$service:latest
docker push ghcr.io/akdasa-studios/lectorium-$service:${{ env.VERSION }}
docker push ghcr.io/akdasa-studios/lectorium-$service:latest
docker pull ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-$service:${{ env.VERSION }}-rc
docker tag ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-$service:${{ env.VERSION }}-rc ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-$service:${{ env.VERSION }}
docker tag ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-$service:${{ env.VERSION }}-rc ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-$service:latest
docker push ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-$service:${{ env.VERSION }}
docker push ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/lectorium-$service:latest
done
#
# Stage 5: Publish mobile apps
#

publish-mobile:
name: Publish / ${{ matrix.config.name }}
runs-on: ubuntu-latest
needs: [deploy-production, build-mobile-production]
needs: [deploy-backend-production, build-mobile-production]
permissions:
contents: read
packages: write
Expand All @@ -192,5 +204,4 @@ jobs:
steps:
- name: Publish App
run: |
echo "Running E2E tests"
echo "Tests passed"
echo "Publishing ${{ matrix.config.name }} app"

0 comments on commit bf9bb38

Please sign in to comment.