-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (58 loc) · 1.94 KB
/
deploy-front.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Deploy Front
on:
workflow_dispatch:
push:
branches: ["dev"]
tags: ["v*"]
paths:
- src/Web/WebAngular/**
- .github/workflows/deploy-front.yml
pull_request:
branches: ["dev"]
paths:
- src/Web/WebAngular/**
- .github/workflows/deploy-front.yml
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "src/Web/WebAngular"
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Docker Login
if: github.event_name != 'pull_request'
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.REGISTRY_LOGIN }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Set image tags
if: github.event_name != 'pull_request'
id: tag
run: |
if [ "${{ startsWith(github.ref, 'refs/tags/') }}" = true ]; then
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
else
echo "::set-output name=tag::dev"
fi
- name: Build and push Docker images (DEV)
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/heads/dev')
uses: docker/build-push-action@v2.7.0
with:
push: ${{ github.event_name != 'pull_request' }}
tags: jpcarpanezi/houston-front:dev
file: src/Web/WebAngular/Dockerfile
context: ./src/Web/WebAngular
- name: Build and push Docker images (TAGS)
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v2.7.0
with:
push: ${{ github.event_name != 'pull_request' }}
tags: |
jpcarpanezi/houston-front:${{ steps.tag.outputs.tag }}
jpcarpanezi/houston-front:latest
file: src/Web/WebAngular/Dockerfile
context: ./src/Web/WebAngular