File tree Expand file tree Collapse file tree 5 files changed +52
-2
lines changed
Expand file tree Collapse file tree 5 files changed +52
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Test docker build custom file
2+ on :
3+ # # Uncomment when test added first time to register workflow and comment it back after workflow would be registered
4+ # #
5+ # # Added pull_request to register workflow from the PR.
6+ # # Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
7+ # pull_request: {}
8+ workflow_dispatch : {}
9+
10+ jobs :
11+ setup :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Setup
15+ run : echo "Do setup"
16+
17+ test :
18+ runs-on : ubuntu-latest
19+ needs : [setup]
20+ steps :
21+ - name : Checkout
22+ uses : actions/checkout@v3
23+
24+ - uses : ./
25+ id : current
26+ with :
27+ workdir : ./test/custom
28+ file : Dockerfile_complex
29+ organization : ${{ github.event.repository.owner.login }}
30+ repository : ${{ github.event.repository.name }}
31+ registry : registry.hub.docker.com
32+ login : ${{ secrets.DOCKERHUB_USERNAME }}
33+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
34+
35+ - uses : nick-fields/assert-action@v1
36+ with :
37+ expected : ' registry.hub.docker.com/cloudposse/github-action-docker-build-push'
38+ actual : ${{ steps.current.outputs.image }}
39+
40+ teardown :
41+ runs-on : ubuntu-latest
42+ needs : [test]
43+ if : ${{ always() }}
44+ steps :
45+ - name : Tear down
46+ run : echo "Do Tear down"
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ Build Docker image and push it.
106106
107107| Name | Description | Default | Required |
108108|------|-------------|---------|----------|
109+ | file | Dockerfile name | Dockerfile | false |
109110| login | Docker login | | false |
110111| organization | Organization | N/A | true |
111112| password | Docker password | | false |
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ inputs:
1111 default : ' ./'
1212 file :
1313 description : ' Dockerfile name'
14- required : false
14+ required : false
15+ default : ' Dockerfile'
1516 organization :
1617 description : ' Organization'
1718 required : true
6869 uses : docker/build-push-action@v2
6970 with :
7071 context : ${{ inputs.workdir }}
71- file : ${{ inputs.file }}
72+ file : ${{ inputs.workdir }}/${{ inputs. file }}
7273 pull : true
7374 push : true
7475 cache-from : type=gha
Original file line number Diff line number Diff line change 33
44| Name | Description | Default | Required |
55| ------| -------------| ---------| ----------|
6+ | file | Dockerfile name | Dockerfile | false |
67| login | Docker login | | false |
78| organization | Organization | N/A | true |
89| password | Docker password | | false |
Original file line number Diff line number Diff line change 1+ FROM nginx:1.23.0-alpine
You can’t perform that action at this time.
0 commit comments