-
-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (48 loc) · 1.39 KB
/
docker-image.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
name: Build and upload Docker for Scout
on:
push:
branches:
- main
repository_dispatch:
types: build-trigger
jobs:
devops:
name: Docker image build
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
images:
- scout
steps:
- uses: actions/checkout@v2
if: ${{ github.event_name == 'push' || github.event_name =='repository_dispatch'}}
with:
ref: main
- name: Free Disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo rm -rf /opt/hostedtoolcache
sudo apt clean
docker rmi $(docker image ls -aq)
df -h
# Build images
- name: Build images
run: |
# Build Image
bash ./build.sh ${{ matrix.images }}
# Log into image registries
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: wildmeorg
password: ${{ secrets.WBIA_WILDMEBOT_DOCKER_HUB_TOKEN }}
- name: Push to Docker Hub (Latest)
if: ${{ github.event_name == 'push' || github.event_name =='repository_dispatch' }}
run: |
VERSION=$(echo ${GITHUB_REF} | sed 's#.*/v##')
bash ./publish.sh -t latest ${PUBLISH_IMAGES}
env:
PUBLISH_IMAGES: ${{ matrix.images }} scout