Hotfixing Dockerfile #46
Workflow file for this run
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: rpi | |
on: | |
push: | |
tags: | |
- v*.**.** | |
jobs: | |
image-creation: | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
mkdir -p exporter-stage/00-install-packages && | |
{ | |
cat > exporter-stage/prerun.sh <<-EOF | |
#!/bin/bash -e | |
if [ ! -d "${ROOTFS_DIR}" ]; then | |
copy_previous | |
fi | |
EOF | |
} && | |
chmod +x exporter-stage/prerun.sh && | |
{ | |
cat > exporter-stage/00-install-packages/00-packages <<-PCK | |
apt-utils | |
curl | |
apt-transport-https | |
ca-certificates | |
gnupg | |
PCK | |
} && | |
{ | |
cat > exporter-stage/00-install-packages/01-run.sh <<-RUN | |
#!/bin/bash -e | |
on_chroot << EOF | |
curl -fsSL https://get.docker.com -o get-docker.sh | |
sh ./get-docker.sh | |
systemctl enable docker | |
curl https://github.com/pstrobl96/prusa_exporter/blob/releases/v1.0.0/docs/examples/config/common/prusa.yml -o /boot/firmware/prusa.yml | |
curl https://raw.githubusercontent.com/pstrobl96/prusa_exporter/main/docs/examples/config/grafana_cloud/agent.yaml -o /boot/firmware/agent.yaml | |
rm -rf /opt/prusa_exporter | |
mkdir /opt/prusa_exporter | |
curl https://github.com/pstrobl96/prusa_exporter/blob/releases/v1.0.0/docker-compose.rpi-cloud.yaml -o /opt/prusa_exporter/docker-compose.yaml | |
curl https://raw.githubusercontent.com/pstrobl96/prusa_exporter/main/docs/services/prusa-exporter-docker.service -o /etc/systemd/system/prusa-exporter.service | |
systemctl enable prusa-exporter | |
EOF | |
RUN | |
} && chmod +x exporter-stage/00-install-packages/01-run.sh | |
- uses: usimd/pi-gen-action@v1 | |
id: build | |
with: | |
hostname: prusa_pi | |
compression-level: 9 | |
compression: xz | |
image-name: prusa_exporter-image | |
stage-list: stage0 stage1 stage2 ./exporter-stage | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: pi-gen-image | |
path: ${{ steps.build.outputs.image-path }} |