Add docker image publish workflow (#374)

This commit is contained in:
Leendert de Borst
2024-11-18 09:33:52 +01:00
parent 6c8cc92a67
commit 5904204465
2 changed files with 76 additions and 1 deletions

View File

@@ -0,0 +1,74 @@
name: Publish Docker Images
on:
release:
types: [published]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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.IMAGE_NAME }}
- name: Build and push API image
uses: docker/build-push-action@v5
with:
context: .
file: src/AliasVault.Api/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}-api:latest,${{ env.REGISTRY }}/${{ github.repository }}-api:${{ github.ref_name }}
- name: Build and push Client image
uses: docker/build-push-action@v5
with:
context: .
file: src/AliasVault.Client/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}-client:latest,${{ env.REGISTRY }}/${{ github.repository }}-client:${{ github.ref_name }}
- name: Build and push Admin image
uses: docker/build-push-action@v5
with:
context: .
file: src/AliasVault.Admin/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}-admin:latest,${{ env.REGISTRY }}/${{ github.repository }}-admin:${{ github.ref_name }}
- name: Build and push SMTP image
uses: docker/build-push-action@v5
with:
context: .
file: src/Services/AliasVault.SmtpService/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}-smtp:latest,${{ env.REGISTRY }}/${{ github.repository }}-smtp:${{ github.ref_name }}
- name: Build and push Reverse Proxy image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}-reverse-proxy:latest,${{ env.REGISTRY }}/${{ github.repository }}-reverse-proxy:${{ github.ref_name }}

View File

@@ -1,5 +1,6 @@
services:
nginx:
reverse-proxy:
image: aliasvault-reverse-proxy
build:
context: .
dockerfile: Dockerfile