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:
parent
df13b26136
commit
2d290dc87f
3 changed files with 104 additions and 0 deletions
34
examples/push-on-tag.yml
Normal file
34
examples/push-on-tag.yml
Normal 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
|
36
examples/push-to-private-registry.yml
Normal file
36
examples/push-to-private-registry.yml
Normal 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
34
examples/simple.yml
Normal 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
|
Loading…
Add table
Reference in a new issue