Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Github actions workflow for publishing images #15

Merged
merged 3 commits into from
Sep 21, 2023
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
96 changes: 96 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Bump version
on:
push:
branches:
- develop

jobs:
tag:
name: bump tags
outputs:
part: ${{ steps.bump_tag.outputs.part }}
tag: ${{ steps.bump_tag.outputs.tag }}
new_tag: ${{ steps.bump_tag.outputs.new_tag }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Bump version and push tag
id: bump_tag
uses: anothrNick/github-tag-action@1.67.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch

push_to_registry:
needs: tag
if: needs.tag.outputs.part != ''
name: Push Docker image to Github Container registry
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
submodules: true

- name: Log in to the Github Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/nbisweden/mimir

- name: Build and push client
uses: docker/build-push-action@v3
with:
context: ./mimir-ui
file: ./mimir-ui/Dockerfile
push: true
tags: |
ghcr.io/nbisweden/mimir-client:${{ needs.tag.outputs.tag }}
ghcr.io/nbisweden/mimir-client:latest
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
org.opencontainers.image.revision=${{ github.sha }}

- name: Build and push backend-wsgi-server
uses: docker/build-push-action@v3
with:
context: ./mimir-server
file: ./mimir-server/Dockerfile
target: wsgi-server
push: true
tags: |
ghcr.io/nbisweden/mimir-backend-wsgi-server:${{ needs.tag.outputs.tag }}
ghcr.io/nbisweden/mimir-backend-wsgi-server:latest
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
org.opencontainers.image.revision=${{ github.sha }}

- name: Build and push backend-web-server
uses: docker/build-push-action@v3
with:
context: ./mimir-server
file: ./mimir-server/Dockerfile
push: true
tags: |
ghcr.io/nbisweden/mimir-backend-web-server:${{ needs.tag.outputs.tag }}
ghcr.io/nbisweden/mimir-backend-web-server:latest
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
org.opencontainers.image.revision=${{ github.sha }}
7 changes: 7 additions & 0 deletions backend-wsgi-server.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ DJANGO_SUPERUSER_USERNAME=mimir
DJANGO_SUPERUSER_PASSWORD=mimirum
DJANGO_SUPERUSER_EMAIL=mimir@example.com
ACCOUNT_EMAIL_VERIFICATION=none
ACCOUNT_EMAIL_REQUIRED=False
EMAIL_HOST=smtp
EMAIL_PORT=8025
EMAIL_HOST_USER=userone
EMAIL_HOST_PASSWORD=passwordone
EMAIL_USE_TLS=True
EMAIL_FROM=webmaster@mimir-test.nbis.se
2 changes: 1 addition & 1 deletion mimir-server
2 changes: 1 addition & 1 deletion mimir-ui