feat(workflow-build): add automatized build on push
This commit is contained in:
parent
5b05c69d6f
commit
a3d14ef71d
60
.gitea/workflows/build.yml
Normal file
60
.gitea/workflows/build.yml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
|
||||||
|
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
|
||||||
|
- 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: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- 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
|
Loading…
x
Reference in New Issue
Block a user