Skip to content

Build DuetPi

Build DuetPi #37

Workflow file for this run

name: Build DuetPi
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Build image
run: |
sudo ./build-docker.sh
- name: Get image date
run: |
IMG_NAME=(deploy/image_*-DuetPi.zip)
if [[ $IMG_NAME =~ ^deploy/image_(.*)-DuetPi.zip$ ]]; then
echo "IMG_DATE=${BASH_REMATCH[1]}" >> $GITHUB_ENV
else
echo "Error: Image not found!"
exit 1
fi
- name: Make new release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "buster-${{ env.IMG_DATE }}"
prerelease: false
title: "DuetPi ${{ env.IMG_DATE }} (buster)"
files: deploy/image_*.zip
- name: Redirect files from pkg.duet3d.com
uses: appleboy/[email protected]
with:
host: pkg.duet3d.com
username: ${{ secrets.PKG_SSH_USER }}
key: ${{ secrets.PKG_SSH_KEY }}
script: |
echo "Redirect /DuetPi.zip https://github.com/Duet3D/DuetPi/releases/latest/download/image_${{ env.IMG_DATE }}-DuetPi.zip" > /var/www/pkg/.htaccess
echo "Redirect /DuetPi-lite.zip https://github.com/Duet3D/DuetPi/releases/latest/download/image_${{ env.IMG_DATE }}-DuetPi-lite.zip" >> /var/www/pkg/.htaccess
echo "Redirect /DuetPi-factory.zip https://github.com/Duet3D/DuetPi/releases/latest/download/image_${{ env.IMG_DATE }}-DuetPi-factory.zip" >> /var/www/pkg/.htaccess