Skip to content

Build Docker Image #985

Build Docker Image

Build Docker Image #985

Workflow file for this run

name: Build Docker Image
on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- master
paths-ignore:
- README.md
- docker-compose.yml
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Get latest xen-orchestra commit hash
id: xo_commit
run: |
echo "XO_COMMIT=$(git ls-remote -q https://github.com/vatesfr/xen-orchestra.git master | awk '{print $1}')" >> $GITHUB_ENV
- name: Get xo-server version
id: xo_version
run: |
echo "XO_VERSION=$(curl -s https://raw.githubusercontent.com/vatesfr/xen-orchestra/${XO_COMMIT}/packages/xo-server/package.json | jq -r .version)" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/[email protected]
with:
images: mkoetter/xen-orchestra
flavor: |
latest=true
tags: |
type=edge
type=schedule,pattern={{date 'YYYYMMDD'}}
type=raw,v${{ env.XO_VERSION }}
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/[email protected]
with:
context: .
build-args: |
XO_COMMIT=${{ env.XO_COMMIT }}
XO_VERSION=${{ env.XO_VERSION }}
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: mkoetter/xen-orchestra
short-description: ${{ github.event.repository.description }}