forked from snapshot-labs/snapshot-hub
-
Notifications
You must be signed in to change notification settings - Fork 7
33 lines (28 loc) · 968 Bytes
/
prod-build.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
name: DockerHub Prod Build
on:
push:
tags:
- '*'
env:
DOCKER_REPO: openlaw/snapshot-hub
IMAGE_NAME: openlaw/snapshot-hub
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check available environment variables
uses: actions/checkout@v2
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v2.x
- name: Build docker image and tag
uses: docker/build-push-action@v1
env:
DOCKER_BUILDKIT: 1
with:
username: ${{ secrets.PUB_REPO_DOCKERHUB_USERNAME }}
password: ${{ secrets.PUB_REPO_DOCKERHUB_ACCESS_TOKEN }}
repository: ${{ env.DOCKER_REPO }}
# Automatically tags the built image with the git short SHA prefixed with the branch name, e.g: vX.Y.Z, latest
tags: ${{ env.GITHUB_REF_SLUG }}, latest
# Only push image on git v* tag
push: ${{ startsWith(github.ref, 'refs/tags/') }}