-
Notifications
You must be signed in to change notification settings - Fork 194
67 lines (64 loc) · 2.75 KB
/
saas-update-backend.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
66
67
name: update-saas-backend
# Deploy backend only if push on "main"
on:
push:
branches: [main, develop, qa, canary]
paths:
- "twake/docker/**"
- "twake/backend/**"
- ".github/workflows/**"
jobs:
deploy-php:
runs-on: ubuntu-20.04
steps:
- run: 'echo "DOCKERTAGVERSION=2023.Q1.1223" >> $GITHUB_ENV'
- name: Set env to develop
if: endsWith(github.ref, '/develop')
run: 'echo "DOCKERTAG=develop" >> $GITHUB_ENV; echo "DOCKERTAGVERSION=2023.Q1.1223" >> $GITHUB_ENV'
- name: Set env to develop
if: endsWith(github.ref, '/qa')
run: 'echo "DOCKERTAG=qa" >> $GITHUB_ENV; echo "DOCKERTAGVERSION=2023.Q1.1223" >> $GITHUB_ENV'
- name: Set env to develop
if: endsWith(github.ref, '/canary')
run: 'echo "DOCKERTAG=canary" >> $GITHUB_ENV; echo "DOCKERTAGVERSION=${{ env.DOCKERTAGVERSION }}-canary" >> $GITHUB_ENV'
- name: Set env to production
if: endsWith(github.ref, '/main')
run: 'echo "DOCKERTAG=latest" >> $GITHUB_ENV'
- uses: actions/checkout@v2
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: twaketech/twake-php
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
workdir: twake
buildoptions: "-t twaketech/twake-php -f docker/twake-php/Dockerfile"
tags: "${{ env.DOCKERTAG }},${{ env.DOCKERTAGVERSION }}"
deploy-node:
runs-on: ubuntu-20.04
steps:
- run: 'echo "DOCKERTAGVERSION=2023.Q1.1223" >> $GITHUB_ENV'
- name: Set env to develop
if: endsWith(github.ref, '/develop')
run: 'echo "DOCKERTAG=develop" >> $GITHUB_ENV; echo "DOCKERTAGVERSION=2023.Q1.1223" >> $GITHUB_ENV'
- name: Set env to develop
if: endsWith(github.ref, '/qa')
run: 'echo "DOCKERTAG=qa" >> $GITHUB_ENV; echo "DOCKERTAGVERSION=2023.Q1.1223" >> $GITHUB_ENV'
- name: Set env to develop
if: endsWith(github.ref, '/canary')
run: 'echo "DOCKERTAG=canary" >> $GITHUB_ENV; echo "DOCKERTAGVERSION=${{ env.DOCKERTAGVERSION }}-canary" >> $GITHUB_ENV'
- name: Set env to production
if: endsWith(github.ref, '/main')
run: 'echo "DOCKERTAG=latest" >> $GITHUB_ENV'
- uses: actions/checkout@v2
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: twaketech/twake-node
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
workdir: twake
context: .
target: production
buildoptions: "-t twaketech/twake-node -f docker/twake-node/Dockerfile"
tags: "${{ env.DOCKERTAG }},${{ env.DOCKERTAGVERSION }}"