Compare commits

...

6 commits

7 changed files with 33 additions and 16 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use nix

View file

@ -14,19 +14,6 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Docker
run: |
apt-get update
apt-get install docker.io -y
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
platforms: linux/amd64,linux/arm64
- name: Get upstream repository - name: Get upstream repository
run: | run: |
git clone https://github.com/ONLYOFFICE/DocumentServer/ upstream git clone https://github.com/ONLYOFFICE/DocumentServer/ upstream
@ -34,19 +21,35 @@ jobs:
- name: Extract tags and labels for Docker - name: Extract tags and labels for Docker
id: meta id: meta
run: | run: |
echo "$(cd upstream && git describe --tags --abbrev=0 | cut -d 'v' -f2-)" export VERSION="$(cd upstream && git describe --tags --abbrev=0 | cut -d 'v' -f2-)"
echo "tag=$(cd upstream && git describe --tags --abbrev=0 | cut -d 'v' -f2-)" >> $GITHUB_OUTPUT echo "Version: ${VERSION}"
echo "tag=${VERSION}" >> $GITHUB_OUTPUT
shell: bash shell: bash
- name: Check if the image was already built - name: Check if the image was already built
id: check-build-status id: check-build-status
run: | run: |
if curl --silent -f -lSL "https://hub.docker.com/v2/repositories/jiriks74/onlyoffice-documentserver/tags/$(echo ${{ steps.meta.outputs.tags }})" > /dev/null; then echo "Already existst" && exit 1; else echo "Desn't exist" && exit 0; fi echo ${{ steps.meta.outputs.tag }}
if curl --silent -f -lSL "https://hub.docker.com/v2/repositories/jiriks74/onlyoffice-documentserver/tags/$(echo ${{ steps.meta.outputs.tag }})" > /dev/null; then echo "Already exists" && exit 1; else echo "Desn't exist" && exit 0; fi
- name: Set tag in Dockerfile - name: Set tag in Dockerfile
run: | run: |
sed -i "s/ARG PACKAGE_VERSION=/ARG PACKAGE_VERSION=$(echo ${{ steps.meta.outputs.tag }} | cut -d ':' -f2)/g" Dockerfile sed -i "s/ARG PACKAGE_VERSION=/ARG PACKAGE_VERSION=$(echo ${{ steps.meta.outputs.tag }} | cut -d ':' -f2)/g" Dockerfile
- name: Update repositories
run: sudo apt update
- name: Install Docker
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: docker.io
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
platforms: linux/amd64,linux/arm64
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# Nix, direnv
.direnv

11
default.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs ? (import <nixpkgs> {
config.allowUnfree = true;
}),
}:
pkgs.mkShell {
pure = true;
packages = with pkgs; [
# Choose the build tools that you need
act
];
}