-
Notifications
You must be signed in to change notification settings - Fork 93
34 lines (34 loc) · 1.01 KB
/
docker.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
name: Docker Image
on:
release:
types: [published]
push:
branches:
- master
jobs:
docker:
name: Docker publishing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get git sha
id: git_sha
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Check outputs
run: echo ${{ steps.git_sha.outputs.sha_short }}
- name: Fail if no git sha
run: exit 1
if: ${{ steps.git_sha.outputs.sha_short == 0 }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: textile/powergate:latest,textile/powergate:sha-${{ steps.git_sha.outputs.sha_short }}