Skip to content

Docker build

Docker build #7

Workflow file for this run

name: Docker build
on:
workflow_dispatch
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get version
id: get_version
run: echo "::set-output name=VERSION::$(cat VERSION)"
- name: Set up Git user
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Build Docker image
run: |
docker build -t manuelrueda/beacon2-ri-tools:${{ steps.get_version.outputs.VERSION }} .
docker tag manuelrueda/beacon2-ri-tools:${{ steps.get_version.outputs.VERSION }} manuelrueda/beacon2-ri-tools:latest
- name: Login to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to Docker Hub
run: |
docker image push manuelrueda/beacon2-ri-tools:${{ steps.get_version.outputs.VERSION }}
docker image push manuelrueda/beacon2-ri-tools:latest