mirror of
https://github.com/nicolabs/nicobot.git
synced 2026-05-21 11:57:34 +02:00
Create dockerhub.yml
Github Action to build & push image to docker hub
This commit is contained in:
parent
39bcabf20f
commit
b75b4c536f
44
.github/workflows/dockerhub.yml
vendored
Normal file
44
.github/workflows/dockerhub.yml
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
# Just followed https://docs.docker.com/ci-cd/github-actions/
|
||||||
|
#
|
||||||
|
|
||||||
|
name: Build and publish to Docker Hub
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
|
# Environment variables available to all jobs and steps in this workflow
|
||||||
|
env:
|
||||||
|
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
|
DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-publish:
|
||||||
|
name: Build, Publish
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
# Download and Install IBM Cloud CLI
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ DOCKER_HUB_USERNAME }}
|
||||||
|
password: ${{ DOCKER_HUB_ACCESS_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
# Build the Docker image
|
||||||
|
- name: Build and push
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: ./
|
||||||
|
file: ./Dockerfile-alpine
|
||||||
|
push: true
|
||||||
|
tags: nicobot:dev
|
||||||
|
|
||||||
|
# Push the image to IBM Container Registry
|
||||||
|
- name: Image digest
|
||||||
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
Loading…
Reference in a new issue