-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.28 KB
/
docker-publish.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
name: Publish Docker image
on:
pull_request:
types:
- closed
branches:
- main
jobs:
generate-version:
runs-on: ubuntu-22.04
permissions:
contents: write
outputs:
new_tag: ${{ steps.bump-version.outputs.new_tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Bump version and push tag
id: bump-version
uses: anothrNick/github-tag-action@1.64.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
MAJOR_STRING_TOKEN: "release("
MINOR_STRING_TOKEN: "feat("
PATCH_STRING_TOKEN: "fix("
DEFAULT_BUMP: minor
build-and-publish:
needs: generate-version
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build ExpressApi and publish to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: vasitos/arequipetapi:latest, vasitos/arequipetapi:${{ needs.generate-version.outputs.new_tag }}