Skip to content

Commit 24f3168

Browse files
authored
Merge pull request #4 from lool/fileserver-upload
ci: debos: upload artifacts to fileserver
2 parents e74cb12 + 8b0d0bd commit 24f3168

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/debos.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ defaults:
2626
env:
2727
INCUS_IMAGE: images:debian/trixie/arm64
2828
INCUS_NAME: debos
29+
FILESERVER_DIR: /srv/gh-runners/quic-yocto/builds
30+
FILESERVER_URL: https://quic-yocto-fileserver-1029608027416.us-central1.run.app
2931

3032
# cancel in progress builds for this workflow triggered by the same ref
3133
concurrency:
@@ -72,8 +74,9 @@ jobs:
7274
# these commands are run inside the container
7375
cat <<EOF
7476
apt update
75-
apt upgrade -y
76-
apt install -y debos
77+
apt -y upgrade
78+
apt -y full-upgrade
79+
apt -y install debos
7780
EOF
7881
) | sudo incus exec "${INCUS_NAME}" -- sh
7982
@@ -97,3 +100,21 @@ jobs:
97100
EOF
98101
) | sudo incus exec "${INCUS_NAME}" -- sh
99102
103+
- name: Upload artifacts to fileserver
104+
run: |
105+
set -x
106+
# curl will be used to talk to fileserver; should be installed by
107+
# default
108+
sudo apt -y install curl
109+
# github runs are only unique per repository and may also be re-run;
110+
# create an unique id with repository, run id, and run attempt
111+
id="${GITHUB_REPOSITORY}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
112+
# create a directory for the current run
113+
dir="${FILESERVER_DIR}/${id}"
114+
mkdir -vp "${dir}"
115+
# copy output files
116+
cp -v disk.img "${dir}"
117+
# instruct fileserver to publish this directory
118+
url="${FILESERVER_URL}/${id}/"
119+
curl -X POST -H 'Accept: text/event-stream' "${url}"
120+

0 commit comments

Comments
 (0)