Skip to content

Zwift build from scratch #28

Zwift build from scratch

Zwift build from scratch #28

name: Zwift build from scratch
on:
workflow_dispatch:
jobs:
zwift_build:
runs-on: ubuntu-22.04
timeout-minutes: 60
concurrency: zwift
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Install dependencies
run: sudo apt-get install -y x11-xserver-utils x11-apps
- uses: netbrain/[email protected]
- name: Checkout
uses: actions/checkout@v4
- name: Build zwift
run: |
set -x
export VERSION=$(curl -s http://cdn.zwift.com/gameassets/Zwift_Updates_Root/Zwift_ver_cur.xml | grep -oP 'sversion="\K.*?(?=")' | cut -f 1 -d ' ')
export BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo "Starting build..."
Xvfb :99 -ac -screen 0 "800x600x24" -nolisten tcp &
sleep 3
export DISPLAY=:99
docker build -t netbrain/zwift:build .
xhost +
docker run --name zwift \
--privileged \
-e DISPLAY=$DISPLAY \
--device /dev/dri \
-v /tmp:/tmp \
netbrain/zwift:build
docker commit --change="LABEL org.opencontainers.image.created=$BUILD_DATE" \
--change="LABEL org.opencontainers.image.version=$VERSION" \
--change='CMD [""]' \
-m "built from scratch from version $VERSION" \
zwift \
netbrain/zwift:$VERSION
docker tag netbrain/zwift:$VERSION netbrain/zwift:latest
docker push netbrain/zwift:$VERSION
docker push netbrain/zwift:latest