Created
March 5, 2021 08:25
-
-
Save taefreeze/4960e75f58f7a92d71d6f40a85a08e82 to your computer and use it in GitHub Desktop.
Git Actions - Docker login/build/push sample
This file contains hidden or 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 Build Example | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: docker login | |
uses: docker/login-action@v1 | |
//use git secrets from repo setting | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: docker build | |
run: | | |
docker build -t myimage:latest . | |
- name: docker push | |
run: | | |
docker push myimage:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment