Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: docker

on:
push:
branches: [ master ]
tags: [ 'v*' ]
pull_request:
branches: [ master ]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

env:
DOCKER_PUBLISH: true

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Disable docker publishing if in PR build
if: ${{ github.event_name == 'pull_request' }}
run: echo "Docker publishing in PR is disabled"
env:
DOCKER_PUBLISH: false

- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push docker image
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
push: ${{ env.DOCKER_PUBLISH }}
tags: okmo/renode:latest
cache-from: type=registry,ref=okmo/renode:renodecache
cache-to: type=registry,ref=okmo/renode:renodecache,mode=max

- name: Build and push min renode image
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile.min
push: ${{ env.DOCKER_PUBLISH }}
tags: okmo/renodemin:latest
cache-from: type=registry,ref=okmo/renodemin:renodemincache
cache-to: type=registry,ref=okmo/renodemin:renodemincache,mode=max