-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.22 KB
/
compose_push.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
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:
dockerhub_user:
required: true
dockerhub_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: Log in to Docker Hub
run: |
docker login -u ${{ secrets.dockerhub_user }} -p ${{ secrets.dockerhub_pass }}
- name: Compose up
uses: konvenit/workflowator/.github/actions/compose@v12
with:
application-name: ${{ inputs.application-name }}
- name: Push Docker image to Docker Hub
if: ${{ inputs.push_to_docker_hub }}
run: docker compose -f docker-compose.test.yml push ${{ inputs.application-name}}
- name: Stop containers
if: always()
run: docker compose -f docker-compose.test.yml down