2023-09-19 19:12:38 +02:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-09-19 19:15:47 +02:00
|
|
|
tags:
|
|
|
|
- 'v*'
|
2023-09-19 19:12:38 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Extract Version Tag
|
|
|
|
id: extract-version
|
|
|
|
run: echo "docker_tag=$(grep -oP '(?<=FROM nextcloud:)[0-9]+\.[0-9]+\.[0-9]+' Dockerfile)" >> $GITHUB_OUTPUT
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Install Docker
|
|
|
|
run: |
|
|
|
|
apt-get update
|
|
|
|
apt-get install docker.io -y
|
2023-09-19 21:53:49 +02:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2023-09-19 19:12:38 +02:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
|
|
|
driver-opts: network=host
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
|
|
|
|
- name: Build image
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
tags: jiriks74/nextcloud-extended:${{ steps.extract-version.outputs.docker_tag }},jiriks74/nextcloud-extended:latest
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
|
|
|
|
# - name: Build image
|
|
|
|
# uses: docker/build-push-action@v2
|
|
|
|
# with:
|
|
|
|
# push: true
|
|
|
|
# tags:
|
|
|
|
# jiriks74/nextcloud-extended:latest
|
|
|
|
# platforms: linux/amd64,linux/arm64
|
|
|
|
# context: .
|
|
|
|
# file: ./Dockerfile
|
|
|
|
|
|
|
|
# - name: Tag latest
|
|
|
|
# run: |
|
|
|
|
# docker image ls
|
|
|
|
# docker tag nextcloud-extended:${{ steps.extract-version.outputs.docker_tag }} nextcloud-extended:latest
|
|
|
|
# docker push nextcloud-extended:latest
|