Created
April 7, 2020 16:20
-
-
Save Lewiscowles1986/30614146b7f71858faf39bbb17db8c6b to your computer and use it in GitHub Desktop.
Build and push to dockerhub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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