Skip to content

Commit

Permalink
Merge pull request #17 from sensebox/feat/github-action
Browse files Browse the repository at this point in the history
add github action
  • Loading branch information
mariopesch authored Nov 25, 2024
2 parents d30d637 + 3bf9329 commit 402f48a
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Publish Docker Image to GHCR

on:
push:
tags:
- "v*" # Triggers on version tags like v1.0.0
workflow_dispatch: # Allow manual trigger

jobs:
build:
runs-on: ubuntu-latest

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

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

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

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/react-ardublockly-backend:latest
ghcr.io/${{ github.repository_owner }}/react-ardublockly-backend:${{ github.ref_name }}

0 comments on commit 402f48a

Please sign in to comment.