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 494673d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.11.9-slim

ENV GO_VERSION=1.22.1
ENV GO_VERSION=1.22.2
ENV ZIG_VERSION=0.11.0

WORKDIR /
Expand Down

0 comments on commit 494673d

Please sign in to comment.