Skip to content

Commit

Permalink
Merge pull request #5 from JamDevCo/cicd
Browse files Browse the repository at this point in the history
Create docker-image.yml
  • Loading branch information
b4oshany authored Sep 9, 2024
2 parents c4724a3 + cbe4adb commit 61613c3
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Push Docker Image

on:
push:
branches:
- main
pull_request:
branches:
- main

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 Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
# tags: jamaicandevelopers/salary-backend:${{ github.sha }}
tags: jamaicandevelopers/salary-backend:development

- name: Log out of Docker Hub
run: docker logout

0 comments on commit 61613c3

Please sign in to comment.