-
Notifications
You must be signed in to change notification settings - Fork 24
54 lines (45 loc) · 1.54 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build and Deploy Docker Image
on:
push:
tags:
- 'v*'
jobs:
build-and-deploy:
name: Build and Deploy Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
starcoin/starcoin_explorer:latest
starcoin/starcoin_explorer:${{ github.sha }}
build-args: |
REACT_APP_STARCOIN_API_URL=https://doapi.stcscan.io
REACT_APP_STARCOIN_NETWORKS=main,banard,proxima,halley,vega
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Verify push to DockerHub
run: |
echo "Image pushed to DockerHub successfully!"
echo "Tags:"
echo " - starcoin/starcoin_explorer:latest"
echo " - starcoin/starcoin_explorer:${{ github.sha }}"
- name: Deployment notification
if: success()
run: |
echo "Docker image has been successfully built and pushed to DockerHub."
echo "You can pull the latest image using:"
echo "docker pull starcoin/starcoin_explorer:latest"