-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.4 KB
/
deploy.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
name: Deploy
on:
push:
branches: [ master, dev ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "deploy"
deploy:
runs-on: ubuntu-latest
steps:
# Спуливаем содержимое
- uses: actions/checkout@v2
# Устанавливаем
- name: Extract branch name
shell: bash
run: |
echo "::set-env name=BRANCH_NAME::${GITHUB_REF##*/}"
echo "${{ env.BRANCH_NAME }}"
# Собираем контейнер
- name: Build and push image
uses: docker/build-push-action@v1.1.0
with:
repository: hw_front_${{ env.BRANCH_NAME }}
dockerfile: ./Dockerfile
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: new
build_args: BRAHCH_NAME=${{ env.BRANCH_NAME }}
# Деплой
- name: Deploy prod
if: env.BRANCH_NAME == 'master'
uses: wei/curl@v1.1.1
with:
args: -X POST ${{ secrets.DEPLOY_HOST }}/modules/git/public/web-hook.php?uuid=${{ secrets.DEPLOY_FRONT_PROD_TOKEN }}
- name: Deploy dev
if: env.BRANCH_NAME == 'dev'
uses: wei/curl@v1.1.1
with:
args: -X POST ${{ secrets.DEPLOY_HOST }}/modules/git/public/web-hook.php?uuid=${{ secrets.DEPLOY_FRONT_DEV_TOKEN }}