1
0
Fork 0
mirror of https://github.com/docker/build-push-action.git synced 2025-03-31 04:00:08 +02:00

Add workflow examples

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
This commit is contained in:
Nick Adcock 2020-03-11 11:29:59 +00:00
parent df13b26136
commit 2d290dc87f
3 changed files with 104 additions and 0 deletions

34
examples/push-on-tag.yml Normal file
View file

@ -0,0 +1,34 @@
name: Build and push Docker image
on:
push:
branches:
- master
tags:
- '*'
pull_request:
# Enables BuildKit
env:
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# TODO: Change repository to the image's Docker repository name
- name: Build and push image
uses: docker/build-push-action@v0.1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: myorg/myrepo
tag_with_ref: true
add_git_labels: true

View file

@ -0,0 +1,36 @@
name: Build and push Docker image
on:
push:
branches:
- master
tags:
- '*'
pull_request:
# Enables BuildKit
env:
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# TODO: Change `repository` to the image's Docker repository name
# TODO: Change `registry` to your private registry's domain
- name: Build and push image
uses: docker/build-push-action@v0.1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: myorg/myrepo
registry: docker.pkg.github.com
tag_with_ref: true
add_git_labels: true

34
examples/simple.yml Normal file
View file

@ -0,0 +1,34 @@
name: Build and push Docker image
on:
push:
branches:
- master
tags:
- '*'
pull_request:
# Enables BuildKit
env:
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# TODO: Change repository to the image's Docker repository name
- name: Build and push image
uses: docker/build-push-action@v0.1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: myorg/myrepo
tag_with_ref: true
add_git_labels: true