-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.15 KB
/
build-to-docker-hub.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
name: Build to Docker Hub
on:
release:
types: [published]
# push:
# branches:
# - 06-03-22/build-on-release
jobs:
push_image_docker_hub:
name: Push image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout the repo...
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASS }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
env:
TAG: ${{ github.event.release.tag_name }}
with:
context: .
push: true
build-args: APP_VERSION=${{github.event.release.tag_name}}
file: Dockerfile.prod.yml
tags: fnobre11/teste-github-actions:${{github.event.release.tag_name}}
# - name: Dump env
# run: env | sort
# - name: Build Docker Image from ${{ github.event.release.name }}
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# TAG: ${{ github.event.release.tag_name }}
# run: echo "$GITHUB_CONTEXT >>> TAG $TAG"