Skip to content

Commit 0917f27

Browse files
authored
Prepare for prod build--workflow definition for prod branch (#30)
* Parameterization to prepare for deployment to prod * Prepare prod image build
1 parent cc67263 commit 0917f27

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

.github/workflows/build.yaml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches:
55
- dev
66
- stage
7+
- prod
78

89
workflow_dispatch:
910
inputs:
@@ -14,7 +15,7 @@ on:
1415
options:
1516
- ''
1617
- '--no-cache'
17-
18+
1819
jobs:
1920
build:
2021
runs-on: ubuntu-latest
@@ -32,30 +33,17 @@ jobs:
3233
username: ${{ vars.DOCKERHUB_USERNAME }}
3334
password: ${{ secrets.DOCKERHUB_TOKEN }}
3435

35-
# - name: Get last tag
36-
# run: echo "TAG_LAST=$(git describe --tags --abbrev=0 --always)" >> $GITHUB_ENV
37-
38-
# - name: "Build Changelog"
39-
# id: build_changelog
40-
# uses: mikepenz/release-changelog-builder-action@v5
41-
# with:
42-
# toTag: "${{ github.ref }}"
43-
# mode: "HYBRID"
44-
# outputFile: "CHANGELOG.md"
45-
46-
# - name: Print CHANGELOG.md
47-
# run: cat CHANGELOG.md
48-
4936
- name: Set up Docker Buildx
5037
uses: docker/setup-buildx-action@v3
5138

5239
- name: Build and push
53-
run: |
40+
run: |
5441
docker compose -f docker-compose.build.yml --env-file tdei_uw.env build --build-arg CODE_VERSION=${CODE_VERSION} ${{github.event.inputs.build_flag}}
5542
docker compose -f docker-compose.build.yml --env-file tdei_uw.env push
5643
env:
5744
ENV: ${{ vars.ENV }}
5845
CODE_VERSION: ${{ github.sha }}
46+
ENV_NAME_PARAM: "${{ vars.ENV == 'prod' && '' || -${ENV} }}"
5947

6048
# hosts
6149
WS_DOCKER_REGISTRY: ${{ vars.WS_DOCKER_REGISTRY }}
@@ -74,6 +62,7 @@ jobs:
7462
env:
7563
ENV: ${{ vars.ENV }}
7664
CODE_VERSION: ${{ github.sha }}
65+
ENV_NAME_PARAM: "${{ vars.ENV == 'prod' && '' || -${ENV} }}"
7766

7867
# machine to deploy to
7968
AZURE_DOCKER_HOST_IP: ${{ vars.AZURE_DOCKER_HOST_IP }}

0 commit comments

Comments
 (0)