Skip to content

Commit

Permalink
chore: workflow : build docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharbansal22 committed Apr 1, 2024
1 parent ece03d7 commit 717dec8
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Update docker dev image

on:
push:
branches:
- dev

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

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

- name: Install dependencies
run: npm install

- name: Create .env.development file
run: |
echo "PORT=3000" >> .env.development
echo "MONGODB_URI=${{ secrets.MONGODB_URI }}" >> .env.development
echo "NODE_ENV=development" >> .env.development
echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> .env.development
echo "ORIGIN=${{ secrets.ORIGIN }}" >> .env.development
echo "TWILIO_ACCOUNT_SID=${{ secrets.TWILIO_ACCOUNT_SID }}" >> .env.development
echo "TWILIO_AUTH_TOKEN=${{ secrets.TWILIO_AUTH_TOKEN }}" >> .env.development
echo "TWILIO_SERVICE_SID=${{ secrets.TWILIO_SERVICE_SID }}" >> .env.development
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build Docker image
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/swifty-order-service .

- name: Push Docker image
run: docker push ${{ secrets.DOCKER_USERNAME }}/swifty-order-service

0 comments on commit 717dec8

Please sign in to comment.