-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (55 loc) · 2.17 KB
/
prod-zus-example-webapp.yaml
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: 'PROD ZUS-EXAMPLE-WEBAPPS CICD'
on:
workflow_dispatch:
# inputs:
# zusapp:
# description: 'ZUS-WEBAPP: Type true to deploy zus webapp wrt above input branch.'
# default: 'true'
# required: true
jobs:
deploy:
# if: ${{ github.event.inputs.zusapp == 'true' }}
runs-on: prod-zus-example-webapp
outputs:
output1: ${{ steps.docker_build.outputs.COMMIT_TAG }}
steps:
- name: docker stop and remove already running zus-webapp container.
run: |
docker stop zus-webapp || true
docker rm zus-webapp || true
- uses: actions/checkout@v3
# - name: Set Docker Image Tags.
# id: get_info
# run: |
# echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV
# if [[ "${{github.ref}}" == refs/pull/* ]]; then
# tag=${GITHUB_REF/\/merge/}
# echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV
# else
# echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV
# fi
# - name: Login To Docker Repository.
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build & deploy zus.network/hackathon/sample-webapp.
run: |
cd docker.local
docker-compose -f docker-compose-dev.yaml up -d --build
# - name: Build & Push Docker Image.
# id: docker_build
# run: |
# docker build -f ./packages/bolt/docker/dockerfile . -t ${{ secrets.BOLT_REGISTRY }}:latest
# echo $TAG-$SHORT_SHA
# echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT
# docker tag ${{ secrets.BOLT_REGISTRY }}:latest ${{ secrets.BOLT_REGISTRY }}:$TAG-$SHORT_SHA
# docker push ${{ secrets.BOLT_REGISTRY }}:$TAG-$SHORT_SHA
# - name: Push latest
# if: ${{ github.event.inputs.branch }} == 'main'
# run: |
# docker push ${{ secrets.BOLT_REGISTRY }}:latest
# - name: Clean Up The Workspace.
# if: ${{ always() }}
# run: |
# rm -rf ./*