forked from blockscout/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (27 loc) · 1020 Bytes
/
build-push.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
on:
push:
branches:
- 'staging'
name: Docker build and push
env:
IMAGE_REPOSITORY: quainetwork/quaiscan-frontend
jobs:
push:
name: Docker build and push
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.PROTOFIRE_DOCKERHUB_USERNAME }}
password: ${{ secrets.PROTOFIRE_DOCKERHUB_TOKEN }}
- name: Prepare image tag
shell: bash
run: |
echo "IMAGE_TAG=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
- name: Build and push
run: |
docker build -t ${{ env.IMAGE_REPOSITORY }}:staging-${{ env.IMAGE_TAG }} -t ${{ env.IMAGE_REPOSITORY }}:staging-latest --build-arg GIT_COMMIT_SHA=${{ env.IMAGE_TAG }} --build-arg GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }} -f Dockerfile .
docker push ${{ env.IMAGE_REPOSITORY }} --all-tags