Skip to content

Merge pull request #7 from Okabe-Junya/junya/docs/add-badge #3

Merge pull request #7 from Okabe-Junya/junya/docs/add-badge

Merge pull request #7 from Okabe-Junya/junya/docs/add-badge #3

Workflow file for this run

name: docker-build
on:
push:
branches:
- "master"
workflow_dispatch:
inputs:
no-cache:
description: "Whether to use cache or not"
required: false
default: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
no-cache: ${{ inputs.no-cache == true }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ns3-gym:latest
cache-from: type=gha
cache-to: type=gha,mode=max