Skip to content

Commit

Permalink
🐳 Add workflow to build & push docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
arjxn-py committed Apr 22, 2024
1 parent 7ecd2be commit 904405a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and push Docker images to Docker Hub

on:
workflow_dispatch:
push:
branches:
- main

jobs:
build_docker_image:
# This workflow is only of value to Owner and would always be skipped in forks
if: github.repository_owner == 'agriyakhetarpal'
name: Build image
runs-on: buildjet-2vcpu-ubuntu-2204-arm

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
tags: agriyakhetarpal/hugo:latest # To be updated with exact Docker Hub username and image name
push: true
platforms: linux/amd64, linux/arm64

- name: List built image(s)
run: docker images

0 comments on commit 904405a

Please sign in to comment.