-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 1.07 KB
/
push.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
on: push
name: Lint
jobs:
dockerfile-lint:
name: dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run hadolint
uses: hadolint/hadolint-action@v3.1.0
with:
trusted-registries: docker.io
test:
name: Build image and test basic functionality
if: '!github.event.deleted'
runs-on: ubuntu-latest
needs: dockerfile-lint
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Build image and test
run: |
docker build -t testimage .
mkdir srv && sudo chown 1000:1000 srv
docker run --name backstore -v $PWD/srv:/srv -d testimage
# Give it a chance to boot
sleep 3
IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' backstore)
docker cp backstore:/srv/.ssh/id_rsa id_rsa
echo "This is a test" > testfile
rsync --progress -e 'ssh -i id_rsa -p 1984 -o StrictHostKeyChecking=no' -ra testfile store@$IP:backstore/
curl http://$IP/testfile | grep "This is a test"