-
Notifications
You must be signed in to change notification settings - Fork 34
51 lines (45 loc) · 1.15 KB
/
build_and_push_main_image.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
50
51
##
# DOCKER BUILD: Dockerfile.g3wsuite.dockerfile
##
name: Build G3W-SUITE image
on:
push:
branches:
- dev
schedule:
- cron: "0 4 * * *"
jobs:
build:
runs-on: ubuntu-20.04
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Extract branch name
shell: bash
run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile.g3wsuite.dockerfile
push: true
tags: g3wsuite/g3w-suite:${{ env.BRANCH_NAME }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}