Skip to content

Build and Push Docker Image #10

Build and Push Docker Image

Build and Push Docker Image #10

name: Build and Push Docker Image
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/ronasit/php-nginx-dev-wkhtmltopdf:latest
ghcr.io/ronasit/php-nginx-dev-wkhtmltopdf:${{ github.sha }}
ghcr.io/ronasit/php-nginx-dev-wkhtmltopdf:${{ github.ref_name }}