From 9615634bf9913689acbef5a84e72a04722358efb Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Mon, 2 Jun 2025 23:38:54 +0200 Subject: [PATCH] Add docker build and push back to release.yml (#887) --- .github/workflows/release.yml | 107 +++++++++++++++++++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 603dc1fe8..8588ba102 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,4 +82,109 @@ jobs: ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} \ No newline at end of file + ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} + + build-and-push-docker: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Convert repository name to lowercase + run: | + echo "REPO_LOWER=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }} + + - name: Build and push Postgres image + uses: docker/build-push-action@v5 + with: + context: . + file: apps/server/Databases/AliasServerDb/Dockerfile + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-postgres:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-postgres:${{ github.ref_name }} + + - name: Build and push API image + uses: docker/build-push-action@v5 + with: + context: . + file: apps/server/AliasVault.Api/Dockerfile + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-api:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-api:${{ github.ref_name }} + + - name: Build and push Client image + uses: docker/build-push-action@v5 + with: + context: . + file: apps/server/AliasVault.Client/Dockerfile + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-client:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-client:${{ github.ref_name }} + + - name: Build and push Admin image + uses: docker/build-push-action@v5 + with: + context: . + file: apps/server/AliasVault.Admin/Dockerfile + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-admin:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-admin:${{ github.ref_name }} + + - name: Build and push Reverse Proxy image + uses: docker/build-push-action@v5 + with: + context: . + file: apps/server/Dockerfile + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-reverse-proxy:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-reverse-proxy:${{ github.ref_name }} + + - name: Build and push SMTP image + uses: docker/build-push-action@v5 + with: + context: . + file: apps/server/Services/AliasVault.SmtpService/Dockerfile + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-smtp:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-smtp:${{ github.ref_name }} + + - name: Build and push TaskRunner image + uses: docker/build-push-action@v5 + with: + context: . + file: apps/server/Services/AliasVault.TaskRunner/Dockerfile + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-task-runner:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-task-runner:${{ github.ref_name }} + + - name: Build and push InstallCli image + uses: docker/build-push-action@v5 + with: + context: . + file: apps/server/Utilities/AliasVault.InstallCli/Dockerfile + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-installcli:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-installcli:${{ github.ref_name }} \ No newline at end of file