-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (67 loc) · 2.61 KB
/
compose_push.yaml
File metadata and controls
80 lines (67 loc) · 2.61 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
name: docker compose build and push to docker hub
on:
workflow_call:
inputs:
application-name:
required: true
type: string
tag:
required: false
type: string
default: ${{ github.event.pull_request.head.sha || github.sha }}
push_to_docker_hub:
required: false
default: true
type: boolean
secrets:
nexus_user:
required: true
nexus_pass:
required: true
makandra_registry_user:
required: true
makandra_registry_pass:
required: true
env:
TAG: ${{ inputs.tag }}
jobs:
compose_push:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Setup Nexus Access
run: |
echo "$(dig +short mice-prod-web01.dns.boreus.de) miceportal.nexus-registry-mice.boreus.de" | sudo tee -a /etc/hosts
docker login miceportal.nexus-registry-mice.boreus.de -u ${{ secrets.nexus_user }} -p ${{ secrets.nexus_pass }}
- name: Setup Makandra Registry Access
run: |
docker login registry.stage.miceportal.makandra.cloud -u ${{ secrets.makandra_registry_user }} -p ${{ secrets.makandra_registry_pass }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: konvenitdeployer
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compose up
uses: konvenit/workflowator/.github/actions/compose@v16
with:
application-name: ${{ inputs.application-name }}
- name: Push Docker image to Nexus
if: ${{ inputs.push_to_docker_hub }}
run: docker compose -f docker-compose.test.yml push ${{ inputs.application-name}}
- name: Push Docker image to Makandra Registry
if: ${{ inputs.push_to_docker_hub }}
run: |
docker tag $(docker compose -f docker-compose.test.yml images ${{ inputs.application-name}} -q) registry.stage.miceportal.makandra.cloud/${{ inputs.application-name}}:${{ inputs.tag }}
docker push registry.stage.miceportal.makandra.cloud/${{ inputs.application-name}}:${{ inputs.tag }}
- name: Push Docker image to Github Registry
if: ${{ inputs.push_to_docker_hub }}
run: |
docker tag $(docker compose -f docker-compose.test.yml images ${{ inputs.application-name}} -q) ghcr.io/konvenit/${{ inputs.application-name}}:${{ inputs.tag }}
docker push ghcr.io/konvenit/${{ inputs.application-name}}:${{ inputs.tag }}
- name: Stop containers
if: always()
run: docker compose -f docker-compose.test.yml down