This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
86 lines (66 loc) · 2.75 KB
/
docker.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
name: Docker
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- name: get Sysbox
run: wget https://downloads.nestybox.com/sysbox/releases/v0.6.1/sysbox-ce_0.6.1-0.linux_amd64.deb
- name: Install Sysbox
run: sudo apt-get install ./sysbox-ce_0.6.1-0.linux_amd64.deb
- name: Configure Sysbox runtime
run: sudo cp sysbox/daemon.json /etc/docker/daemon.json
- name: Restart docker service
run: sudo systemctl restart docker.service
- name: Build docker
run: make docker-buildkit
env:
DOCKER_USER_NAME: achimcc
- name: Tag Docker image
run: docker tag achimcc/ink-playground:latest ink-playground
- name: Add single version to versions list (storage limitation of github actions)
run: echo "[\"4.2.0\"]" > ./config/versions.json
- name: Run docker
run: DOCKER_CI_VOLUME_MOUNT="--volume ./config/versions.json:/app/config/versions.json" make docker-run-detach
env:
DOCKER_PORT: 4000
- name: Sleep for 120s, allow Docker image to boot up
uses: juliangruber/sleep-action@v1
with:
time: 120s
- name: Install docker-tests
run: yarn workspace docker-tests install
- name: Test docker
run: make docker-test
env:
DOCKER_PORT: 4000
- name: docker log
if: always()
run: make docker-log
- name: Login to DockerHub
if: github.ref == 'refs/heads/main' && github.repository == 'paritytech/ink-playground'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER_NAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Push Docker image
if: github.ref == 'refs/heads/main' && github.repository == 'paritytech/ink-playground'
run: docker push ${{ secrets.DOCKER_USER_NAME }}/ink-playground
- name: Generate build number
if: github.ref == 'refs/heads/main' && github.repository == 'paritytech/ink-playground'
uses: einaregilsson/build-number@v3
with:
token: ${{secrets.github_token}}
- name: Print new build number
if: github.ref == 'refs/heads/main' && github.repository == 'paritytech/ink-playground'
run: echo "Build number is $BUILD_NUMBER"
- name: Apply build number Tag to Docker image
run: docker tag achimcc/ink-playground:latest achimcc/ink-playground:1.0.$BUILD_NUMBER
- name: Push version tagged Docker image
if: github.ref == 'refs/heads/main' && github.repository == 'paritytech/ink-playground'
run: docker push ${{ secrets.DOCKER_USER_NAME }}/ink-playground:1.0.$BUILD_NUMBER