Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
693a2df9fThis file is pinned to the selected release. Download the original to open it in your design tool.
name: Build Docker
on:
push:
branches:
- main
- 'feature/*'
pull_request:
branches:
- main
jobs:
# Step 1: Build Docker image and push to registry
build:
name: Build Docker Image
runs-on: ubuntu-latest
timeout-minutes: 360 # Increase to 6 hours (the max for hosted runners)
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: DevOps/Dockerfile
push: true
tags: |
ghcr.io/robertgawron/hardwaredatalogger:${{ github.sha }}
ghcr.io/robertgawron/hardwaredatalogger:latest
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false