forked from ava-labs/avalanche-wallet
-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (47 loc) · 1.48 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: docker
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: '18'
- id: branchVars
name: Evaluate branch
run: |
if [[ ${{ github.event_name }} != workflow_dispatch ]]; then
echo "ref=${{ github.head_ref }}" >> $GITHUB_OUTPUT
else
echo "ref=${{ github.event.inputs.wd_branch }}" >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
with:
ref: ${{ steps.branchVars.outputs.ref }}
fetch-depth: 0
- uses: docker/login-action@v2
name: Login to DockerHub
with:
username: ${{ secrets.docker_username }}
password: ${{ secrets.docker_pass }}
- name: Set tag variables
id: setTagVariables
run: |
if [[ ${{ github.ref_type }} == tag ]]; then
echo "version=stable-${{ github.ref_name }}" >> $GITHUB_OUTPUT
else
SHORT_SHA=$(git rev-parse --short HEAD)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "version=unstable-${BRANCH}-${SHORT_SHA}" >> $GITHUB_OUTPUT
fi
- name: Build image and push to Docker Hub and GitHub Container Registry
uses: docker/build-push-action@v3
with:
context: ./
tags: |
c4tplatform/camino-wallet:${{ steps.setTagVariables.outputs.version }}
push: false