forked from osmosis-labs/osmosis-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (83 loc) · 2.67 KB
/
push-docker-images.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
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
86
87
# This workflow pushes osmosis docker images on every commit to master.
#
# The following images are pushed:
#
# - `osmolabs/osmosis-frontend:{COMMIT_SHORT_SHA}
# - `osmolabs/osmosis-frontend-frontier:{COMMIT_SHORT_SHA}
# - `osmolabs/osmosis-frontend-testnet:{COMMIT_SHORT_SHA}
#
# All the images above have support for linux/amd64 and linux/arm64.
#
# Due to QEMU virtualization used to build multi-platform docker images
# this workflow might take a while to complete.
name: Push Docker Images
on:
push:
branches:
- master
env:
FRONTEND_DOCKER_REPOSITORY: osmolabs/osmosis-frontend
FRONTIER_DOCKER_REPOSITORY: osmolabs/osmosis-frontend-frontier
TESTNET_DOCKER_REPOSITORY: osmolabs/osmosis-frontend-testnet
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Check out repo
uses: actions/checkout@v3
-
name: Get Short SHA
uses: benjlevesque/short-sha@v2.1
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Get current date
run: |
echo "DATE=$(date +%s)" >> $GITHUB_ENV
-
name: Build and push (main)
uses: docker/build-push-action@v3
with:
file: ./docker/Dockerfile
context: .
push: true
platforms: linux/amd64
tags: |
${{ env.FRONTEND_DOCKER_REPOSITORY }}:${{ env.SHA }}
${{ env.FRONTEND_DOCKER_REPOSITORY }}:${{ env.SHA }}-${{ env.DATE }}
${{ env.FRONTEND_DOCKER_REPOSITORY }}:latest
-
name: Build and push (frontier)
uses: docker/build-push-action@v3
with:
file: ./docker/Dockerfile.frontier
context: .
push: true
platforms: linux/amd64
tags: |
${{ env.FRONTIER_DOCKER_REPOSITORY }}:${{ env.SHA }}
${{ env.FRONTIER_DOCKER_REPOSITORY }}:${{ env.SHA }}-${{ env.DATE }}
${{ env.FRONTIER_DOCKER_REPOSITORY }}:latest
-
name: Build and push (testnet)
uses: docker/build-push-action@v3
with:
file: ./docker/Dockerfile.testnet
context: .
push: true
platforms: linux/amd64
tags: |
${{ env.TESTNET_DOCKER_REPOSITORY }}:${{ env.SHA }}
${{ env.TESTNET_DOCKER_REPOSITORY }}:${{ env.SHA }}-${{ env.DATE }}
${{ env.TESTNET_DOCKER_REPOSITORY }}:latest