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
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
57 changes: 57 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Docker build and push

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

jobs:
build-push:
runs-on: ubuntu-latest
steps:
# - name: Maximize build disk space
# uses: easimon/maximize-build-space@v10
# with:
# remove-dotnet: true
# remove-android: true
# remove-haskell: true
# remove-codeql: true
# remove-docker-images: true

- name: Resize /dev/shm
run: |
sudo mount -o remount,size=4G /dev/shm

- name: Mount /var as tmpfs
run: |
sudo mount -t tmpfs -o size=30G tmpfs /var/lib/docker

- 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 }}
32 changes: 32 additions & 0 deletions .github/workflows/max-space.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: My build action requiring more space

on: workflow_dispatch

jobs:
build:
name: Build my artifact
runs-on: ubuntu-latest
steps:
- name: Free space before
run: |
echo "Free space before:"
df -h

- name: Maximize build disk space
uses: easimon/maximize-build-space@v10
with:
# need space in /var for Docker images
root-reserve-mb: 30000
remove-dotnet: true
remove-android: true
remove-haskell: true
remove-codeql: true
remove-docker-images: true

- name: Checkout
uses: actions/checkout@v3

- name: Free space after
run: |
echo "Free space after:"
df -h
Loading