Skip to content

Automate Docker builds using GitHub actions #1

Automate Docker builds using GitHub actions

Automate Docker builds using GitHub actions #1

Workflow file for this run

name: Build and publish Docker image
on:
push:
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/[email protected]
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value={{sha}}
- name: Build and push Docker image
uses: docker/[email protected]
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}