Skip to content

Commit

Permalink
Merge pull request #375 from lanedirt/374-publish-docker-images-on-re…
Browse files Browse the repository at this point in the history
…lease

Publish docker images on release
  • Loading branch information
lanedirt authored Nov 18, 2024
2 parents 6c8cc92 + 5904204 commit 319cff8
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 1 deletion.
74 changes: 74 additions & 0 deletions .github/workflows/publish-docker-images.yml
Original file line number Diff line number Diff line change
@@ -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 }}
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
services:
nginx:
reverse-proxy:
image: aliasvault-reverse-proxy
build:
context: .
dockerfile: Dockerfile
Expand Down

0 comments on commit 319cff8

Please sign in to comment.