-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (29 loc) · 1.28 KB
/
githubaction.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
name: Build and Push Docker Image
on:
push:
branches:
- develop
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Configure Docker daemon for insecure registry
run: |
echo '{"insecure-registries":["58.79.16.12:5000"]}' | sudo tee /etc/docker/daemon.json > /dev/null
sudo systemctl restart docker
- name: Log in to Docker registry using HTTP
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login http://58.79.16.12:5000 --username ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Show build context files
run: ls -R
- name: Build Docker image
run: |
docker build --no-cache --build-arg REACT_APP_API_BASE_URL=${{ secrets.REACT_APP_API_BASE_URL }} -f Dockerfile -t 58.79.16.12:5000/athlete_user_frontend:${{ github.sha }} .
- name: Push Docker image to registry
run: |
docker push 58.79.16.12:5000/athlete_user_frontend:${{ github.sha }}
- name: Add additional tag and push
run: |
docker tag 58.79.16.12:5000/athlete_user_frontend:${{ github.sha }} 58.79.16.12:5000/athlete_user_frontend:latest
docker push 58.79.16.12:5000/athlete_user_frontend:latest