Agent-Logs-Url: https://github.com/gabriel20xx/CollabTable/sessions/aef8ec67-fa60-4789-b968-81db2b5c793c Co-authored-by: gabriel20xx <21219769+gabriel20xx@users.noreply.github.com>
38 lines
928 B
YAML
38 lines
928 B
YAML
name: Build and Publish Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to Docker Hub
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./CollabTableServer
|
|
file: ./CollabTableServer/Dockerfile
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: |
|
|
gabriel20xx/collabtable:latest
|
|
gabriel20xx/collabtable:${{ github.sha }}
|