Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Build and push to dockerhub
name: Docker Image CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to dockerhub
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- name: Build the docker image
run: docker build . --file Dockerfile --tag cd2team/mailhog:build
- name: Tag and push
docker tag cd2team/mailhog:build cd2team/mailhog:latest
docker tag cd2team/mailhog:latest cd2team/mailhog:$(date +%s)
docker push cd2team/mailhog:$(date +%s)
docker push cd2team/mailhog:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.