Weekly Build #135
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Weekly Build | |
on: | |
# once a week build a new image: At 02:30 on Monday. | |
schedule: | |
- cron: "30 2 * * 1" | |
# or manually | |
workflow_dispatch: | |
jobs: | |
# Prebuild: get variables from XOA official repos | |
pre-build: | |
runs-on: ubuntu-latest | |
outputs: | |
xoserver: ${{ steps.xoa-version.outputs.xoaserver }} | |
xoweb: ${{ steps.xoa-version.outputs.xoaweb }} | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- | |
name: Add python | |
uses: actions/setup-python@v4.3.0 | |
with: | |
python-version: '3.10' | |
- | |
name: Checkout scripts | |
uses: actions/checkout@v3.1.0 | |
- | |
name: Get XOA server version | |
id: xoa-version | |
run: python scripts/xoa_versions.py | |
- | |
name: Set global version | |
id: version | |
env: | |
XOASERVER: ${{ steps.xoa-version.outputs.xoaserver }} | |
run: | | |
VERSION=$(echo ${XOASERVER} | sed -rn 's/([[:digit:]]+\.[[:digit:]]+)\..*/\1/p') | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
# build XO in a docker | |
docker-build: | |
needs: pre-build | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3.1.0 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2.1.0 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2.2.1 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v2.1.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v3.2.0 | |
with: | |
context: alpine | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
ezka77/xen-orchestra-ce:latest | |
ezka77/xen-orchestra-ce:${{ needs.pre-build.outputs.version }} | |
build-args: | | |
VERSION=${{ needs.pre-build.outputs.version }} | |
XOSERVER=${{ needs.pre-build.outputs.xoserver }} | |
XOWEB=${{ needs.pre-build.outputs.xoweb }} |