-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.14 KB
/
docker-build.yaml
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
name: Docker
on:
push:
branches:
- main
jobs:
Docker-main-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Images
run: |
docker build . --file Dockerfile --target build1 -t uri-image:latest
docker build . --file Dockerfile --target build2 -t api-image:latest
- name: push to dockerhub
run: |
docker login -u stefnie -p ${{ secrets.docker_hub_token }}
docker tag api-image:latest stefnie/api-image:latest
docker push stefnie/api-image:latest
docker tag uri-image:latest stefnie/uri-image:latest
docker push stefnie/uri-image:latest
Docker-compose:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
docker-compose --version
- name: run containers
run: |
docker login -u stefnie -p ${{ secrets.docker_hub_token }}
docker-compose -f compose.yaml pull
docker-compose -f compose.yaml up -d