-
Notifications
You must be signed in to change notification settings - Fork 115
43 lines (42 loc) · 1.3 KB
/
docker.yaml
File metadata and controls
43 lines (42 loc) · 1.3 KB
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
name: Build Dev Docker Image
on:
push:
tags:
- 'v*'
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Docker login
uses: docker/login-action@v1
with:
username: ${{ secrets.QUAY_IO_BOT_USERNAME }}
password: ${{ secrets.QUAY_IO_BOT_PASSWORD }}
registry: quay.io
- uses: olegtarasov/get-tag@v2.1
id: tag-name
- uses: benjlevesque/short-sha@v3.0
id: short-sha
with:
length: 7
- name: Build and publish tag docker image
uses: docker/build-push-action@v3
if: startsWith(github.ref, 'refs/tags/')
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: quay.io/subscan-explorer/subscan-essentials:${{ steps.tag-name.outputs.tag }}
- name: Build and publish SHA docker image
uses: docker/build-push-action@v3
if: startsWith(github.ref, 'refs/tags/') == false
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: quay.io/subscan-explorer/subscan-essentials:sha-${{ steps.short-sha.outputs.sha }}-${{ github.run_number }}