-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.6 KB
/
docker_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Update docker dev image
on:
push:
branches:
- main
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
env:
PORT: ${{ secrets.PORT }}
MONGODB_URI: ${{ secrets.MONGODB_URI }}
NODE_ENV: development
JWT_SECRET: ${{ secrets.JWT_SECRET }}
ORIGIN: ${{ secrets.ORIGIN }}
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }}
TWILIO_SERVICE_SID: ${{ secrets.TWILIO_SERVICE_SID }}
run: |
echo "PORT=$PORT" >> .env.development
echo "MONGODB_URI=$MONGODB_URI" >> .env.development
echo "NODE_ENV=development" >> .env.development
echo "JWT_SECRET=$JWT_SECRET" >> .env.development
echo "ORIGIN=$ORIGIN" >> .env.development
echo "TWILIO_ACCOUNT_SID=$TWILIO_ACCOUNT_SID" >> .env.development
echo "TWILIO_AUTH_TOKEN=$TWILIO_AUTH_TOKEN" >> .env.development
echo "TWILIO_SERVICE_SID=$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