diff --git a/examples/push-on-tag.yml b/examples/push-on-tag.yml new file mode 100644 index 0000000..b261983 --- /dev/null +++ b/examples/push-on-tag.yml @@ -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 diff --git a/examples/push-to-private-registry.yml b/examples/push-to-private-registry.yml new file mode 100644 index 0000000..f72acaf --- /dev/null +++ b/examples/push-to-private-registry.yml @@ -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 diff --git a/examples/simple.yml b/examples/simple.yml new file mode 100644 index 0000000..b261983 --- /dev/null +++ b/examples/simple.yml @@ -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