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

Add docker build-push gh action #19

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Next Next commit
add docker build-push gh action
Signed-off-by: Anupam Kumar <[email protected]>
kyteinsky committed Mar 13, 2024

Verified

This commit was signed with the committer’s verified signature.
kyteinsky Anupam Kumar
commit adc99822ddc2d9e3aefe09cbab0dd11ab6942f2c
39 changes: 39 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docker build and push

on:
workflow_dispatch:
push:
tags:
- '**'

jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract app's version from info.xml
id: getversion
uses: mavrosxristoforos/[email protected]
with:
xml-file: 'appinfo/info.xml'
xpath: '/info/version'

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/nextcloud/context_chat_backend:latest,ghcr.io/nextcloud/context_chat_backend:${{ steps.getversion.outputs.info }}