forked from RPi-Distro/pi-gen
-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (38 loc) · 1.58 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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