Skip to content
name: Build and Push Docker Image
on:
push:
branches:
- adv-docker-example
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: latest
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: "./solutions/hello-docker"
file: "./solutions/hello-docker/Dockerfile.production"
push: true
tags: ${{ steps.meta.outputs.tags }}