-
Notifications
You must be signed in to change notification settings - Fork 891
86 lines (76 loc) · 3.76 KB
/
docker-image.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Build and Push Docker Image to Docker Hub
on:
pull_request:
types:
- closed
branches:
- dev
#Allow repo secrets
env:
VITE_ALCHEMY_KEY: ${{ secrets.VITE_ALCHEMY_KEY }}
jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
ref: 'dev'
- name: login to docker registry
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: build and push rair-node docker image to registry
uses: docker/build-push-action@v5
with:
context: rair-node/
push: true
tags: |
${{secrets.DOCKERHUB_USERNAME}}/rair-node:${{github.sha}}
${{secrets.DOCKERHUB_USERNAME}}/rair-node:latest
- name: build and push rair-front docker image to registry
run: cp rair-front/.env.sample rair-front/.env
- name: appending VITE_MATIC_MAINNET_ALCHEMY_KEY in .env file
run: echo "VITE_MATIC_MAINNET_ALCHEMY_KEY"=${{ secrets.VITE_MATIC_MAINNET_ALCHEMY_KEY }} >> rair-front/.env
- name: appending VITE_MATIC_MAINNET_GAS_POLICY in .env file
run: echo "VITE_MATIC_MAINNET_GAS_POLICY"=${{ secrets.VITE_MATIC_MAINNET_GAS_POLICY }} >> rair-front/.env
- name: appending VITE_ETH_MAINNET_ALCHEMY_KEY in .env file
run: echo "VITE_ETH_MAINNET_ALCHEMY_KEY"=${{ secrets.VITE_ETH_MAINNET_ALCHEMY_KEY }} >> rair-front/.env
- name: appending VITE_ETH_MAINNET_GAS_POLICY in .env file
run: echo "VITE_ETH_MAINNET_GAS_POLICY"=${{ secrets.VITE_ETH_MAINNET_GAS_POLICY }} >> rair-front/.env
- name: appending VITE_BASE_MAINNET_ALCHEMY_KEY in .env file
run: echo "VITE_BASE_MAINNET_ALCHEMY_KEY"=${{ secrets.VITE_BASE_MAINNET_ALCHEMY_KEY }} >> rair-front/.env
- name: appending VITE_BASE_MAINNET_GAS_POLICY in .env file
run: echo "VITE_BASE_MAINNET_GAS_POLICY"=${{ secrets.VITE_BASE_MAINNET_GAS_POLICY }} >> rair-front/.env
- name: appending VITE_ETH_SEPOLIA_ALCHEMY_KEY in .env file
run: echo "VITE_ETH_SEPOLIA_ALCHEMY_KEY"=${{ secrets.VITE_ETH_SEPOLIA_ALCHEMY_KEY }} >> rair-front/.env
- name: appending VITE_ETH_SEPOLIA_GAS_POLICY in .env file
run: echo "VITE_ETH_SEPOLIA_GAS_POLICY"=${{ secrets.VITE_ETH_SEPOLIA_GAS_POLICY }} >> rair-front/.env
- name: build rair-front docker image
run: sudo docker build -t rair-front:${{github.sha}} -f rair-front/Dockerfile.prod rair-front
- name: tag image
run: |
docker tag rair-front:${{github.sha}} ${{secrets.DOCKERHUB_USERNAME}}/rair-front:${{github.sha}}
docker tag rair-front:${{github.sha}} ${{secrets.DOCKERHUB_USERNAME}}/rair-front:latest
- name: Docker push
run: |
docker push ${{secrets.DOCKERHUB_USERNAME}}/rair-front:${{github.sha}}
docker push ${{secrets.DOCKERHUB_USERNAME}}/rair-front:latest
- name: build and push rair-stream docker image to registry
uses: docker/build-push-action@v5
with:
context: rair-stream/
push: true
tags: |
${{secrets.DOCKERHUB_USERNAME}}/rair-stream:${{github.sha}}
${{secrets.DOCKERHUB_USERNAME}}/rair-stream:latest
- name: build and push rair-sync docker image to registry
uses: docker/build-push-action@v5
with:
context: rair-sync/
push: true
tags: |
${{secrets.DOCKERHUB_USERNAME}}/rair-sync:${{github.sha}}
${{secrets.DOCKERHUB_USERNAME}}/rair-sync:latest