Skip to content

Commit

Permalink
Added github image builder action
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-holzner committed Sep 29, 2024
1 parent 986ee80 commit 5f1e2ed
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Docker Build and Push

on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate timestamp
id: timestamp
run: echo "::set-output name=timestamp::$(date +'%Y%m%d%H%M%S')"

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.timestamp.outputs.timestamp }}

0 comments on commit 5f1e2ed

Please sign in to comment.