forked from sei-protocol/sei-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 loc) · 1.8 KB
/
docker_publish.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
name: Create and Push Docker Image
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # ignore rc
jobs:
sei-images:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
-
name: Check out the repo
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Parse tag
id: tag
run: |
VERSION=$(echo ${{ github.ref_name }} | sed "s/v//")
MAJOR_VERSION=$(echo $VERSION | cut -d '.' -f 1)
MINOR_VERSION=$(echo $VERSION | cut -d '.' -f 2)
PATCH_VERSION=$(echo $VERSION | cut -d '.' -f 3)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "MAJOR_VERSION=$MAJOR_VERSION" >> $GITHUB_ENV
echo "MINOR_VERSION=$MINOR_VERSION" >> $GITHUB_ENV
echo "PATCH_VERSION=$PATCH_VERSION" >> $GITHUB_ENV
-
name: Build and push
id: build_push_image
uses: docker/build-push-action@v4
with:
file: Dockerfile
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/sei-protocol/sei:${{ env.MAJOR_VERSION }}
ghcr.io/sei-protocol/sei:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}
ghcr.io/sei-protocol/sei:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }}
ghcr.io/sei-protocol/sei:v${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }}