-
Notifications
You must be signed in to change notification settings - Fork 6
131 lines (126 loc) · 4.66 KB
/
deploy-test.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Deploy main branch & test builds
on:
push:
branches: [main, ci]
jobs:
deploy:
name: Deploy master tag images
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci-skip') && !contains(github.event.head_commit.message, 'skip-ci')"
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Set current date to env variable $DATE_YYYY_MM_DD
id: date
run: echo "DATE_YYYY_MM_DD=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Build base image (with expanded fs, otherwise is too small)
run: docker build -t ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:master --build-arg FILE_SUFFIX=autologin-ssh-expanded .
- name: Tag same base image with date
run: docker tag ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:master ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:master-${{ env.DATE_YYYY_MM_DD }}
- name: Build Mu image
run: docker build -t ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:master-mu --build-arg FILE_SUFFIX=mu .
- name: Push all tags to ghcr.io
run: |
docker push ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:master-${{ env.DATE_YYYY_MM_DD }}
docker push ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:master-mu
docker push ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:master
# This check is not valid, will probably delete soon
check-action-container:
name: Attempt to bash into container master tag
needs: deploy
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:master
options: "--entrypoint /entrypoint.sh"
steps:
- run: uname -a
check-ssh:
name: SSH sample master tag
needs: deploy
runs-on: ubuntu-latest
services:
rpios:
image: ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:master
ports:
- 5022:5022
steps:
- name: Give 2m30s for the docker image to start up QEMU and Raspberry Pi OS
run: sleep 150
- name: Executing remote ssh command 1
uses: appleboy/ssh-action@v1.0.0
with:
host: rpios
username: pi
password: raspberry
port: ${{ job.services.rpios.ports[5022] }}
# QEMU might still take some extra time to start up Raspberry Pi OS
timeout: 5m
script: |
uname -a
cat /etc/os-release
touch my_file.txt
df -h
- name: Executing remote ssh command 2 (check state permanence)
uses: appleboy/ssh-action@v1.0.0
with:
host: rpios
username: pi
password: raspberry
port: ${{ job.services.rpios.ports[5022] }}
script: |
uname -a
cat /etc/os-release
ls
test -f my_file.txt && echo "Previously created file exists."
check-ssh-mu:
name: SSH sample master-mu tag
needs: deploy
runs-on: ubuntu-latest
services:
rpios:
image: ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:master-mu
ports:
- 5022:5022
steps:
- name: Give 2m30s for the docker image to start up QEMU and Raspberry Pi OS
run: sleep 150
- name: Executing remote ssh command 1
uses: appleboy/ssh-action@v1.0.0
with:
host: rpios
username: pi
password: raspberry
port: ${{ job.services.rpios.ports[5022] }}
# QEMU might still take some extra time to start up Raspberry Pi OS
timeout: 5m
script: |
uname -a
cat /etc/os-release
touch my_file.txt
df -h
- name: Executing remote ssh command 2 (check state permanence)
uses: appleboy/ssh-action@v1.0.0
with:
host: rpios
username: pi
password: raspberry
port: ${{ job.services.rpios.ports[5022] }}
script: |
uname -a
cat /etc/os-release
ls
test -f my_file.txt && echo "Previously created file exists."
- name: Check the Mu packages are present
uses: appleboy/ssh-action@v1.0.0
with:
host: rpios
username: pi
password: raspberry
port: ${{ job.services.rpios.ports[5022] }}
script: |
dpkg -s python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtserialport python3-pyqt5.qtsvg