dbc #24
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: dbc | |
on: | |
workflow_run: | |
workflows: [tests] | |
types: | |
- completed | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: docker.io | |
IMAGE_NAME: olegselajev241/todo-demo-application | |
SHA: ${{ github.event.pull_request.head.sha}} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: "lab:latest" | |
driver: cloud | |
endpoint: "docker/devrel" | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/todo-demo-application:latest | |
${{ secrets.DOCKERHUB_USERNAME }}/todo-demo-application:${{ env.SHA }} | |
# For pull requests, export results to the build cache. | |
# Otherwise, push to a registry. | |
outputs: 'type=registry,push=true' | |