Skip to content

Commit

Permalink
created GitHub Action for building and deploying docker images (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
bibonut authored Jan 17, 2025
1 parent ce794a8 commit 556dd7c
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Docker Image CI/CD

on:
push:
branches:
- 'main'
workflow_dispatch:

jobs:
backend:
runs-on: ubuntu-latest

steps:
- name: Check repository
uses: actions/checkout@v4

- name: Get date for tagging
id: date
run: echo "date=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push the Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/server/Dockerfile
push: true
tags: |
${{ vars.DOCKERHUB_USERNAME }}/bluecrew-prod-server:latest
${{ vars.DOCKERHUB_USERNAME }}/bluecrew-prod-server:${{ env.date }}

0 comments on commit 556dd7c

Please sign in to comment.