-
Notifications
You must be signed in to change notification settings - Fork 11
48 lines (41 loc) · 1.54 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
name: Build Linux SDK Docker Image
on:
push:
branches: [ dev* ]
paths-ignore:
- README.md
- LICENSE
- .gitlab-ci.yml
- .gitignore
pull_request:
branches: [ dev* ]
jobs:
# This workflow contains a single job called "build"
build:
name: build docker image
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Linux SDK Code
uses: actions/checkout@v4
with:
submodules: false
- name: Build Docker Image
run: |
cd .github
docker build . -f linuxsdk.Dockerfile -t linuxsdk:${{github.ref_name}}
docker images
- name: Test Docker Image
if: ${{ startsWith(github.ref_name, 'dev_') && github.event_name != 'pull_request' }}
run: |
docker run -i linuxsdk:${{github.ref_name}} bash run_qemu.sh
- name: Publish Docker Image
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "Login to docker hub"
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PWD }} docker.io
DOCKER_REPO=docker.io/nucleisoftware/linuxsdk
docker tag linuxsdk:${{github.ref_name}} ${DOCKER_REPO}:${{github.ref_name}}
docker push ${DOCKER_REPO}:${{github.ref_name}}
echo "Docker image is pushed to https://hub.docker.com/repository/docker/nucleisoftware/linuxsdk, tag ${{github.ref_name}}"