File tree Expand file tree Collapse file tree 4 files changed +50
-5
lines changed Expand file tree Collapse file tree 4 files changed +50
-5
lines changed Original file line number Diff line number Diff line change 1+ name : build-docker-image
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ tag :
7+ description : ' Tag for Docker image'
8+ required : true
9+ ref :
10+ description : ' Branch, tag, or commit SHA to build from'
11+ required : true
12+ default : main
13+
14+ jobs :
15+ build-and-push :
16+ runs-on : ubuntu-latest
17+ timeout-minutes : 300
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v3
21+ with :
22+ ref : ${{ github.event.inputs.ref }}
23+
24+ - name : Log in to DockerHub
25+ uses : docker/login-action@v2
26+ with :
27+ username : ${{ secrets.DOCKERHUB_USERNAME }}
28+ password : ${{ secrets.DOCKERHUB_TOKEN }}
29+
30+ - name : Build and push
31+ 32+ with :
33+ context : .
34+ push : true
35+ tags : octue/get-deployment-info:${{ github.event.inputs.tag }}
Original file line number Diff line number Diff line change 1515 steps :
1616 - uses : actions/checkout@v3
1717
18+ - name : Install poetry
19+ 20+
1821 - name : Get package version
1922 id : get-package-version
2023 run : echo "PACKAGE_VERSION=$(poetry version -s)" >> $GITHUB_OUTPUT
Original file line number Diff line number Diff line change 11name : test-deployment-info
22
33on :
4- push :
4+ pull_request :
5+ branches :
6+ - main
57
68jobs :
79 info :
@@ -23,10 +25,10 @@ jobs:
2325 id : get-deployment-info
2426 uses : ./
2527 with :
26- gcp_project_name : test-project
28+ gcp_project_name : my- test-project
2729 gcp_project_number : 1234
28- gcp_region : europe-west1
29- gcp_resource_affix : test
30+ gcp_region : europe-west6
31+ gcp_resource_affix : my-affix
3032 gcp_service_name : my-test-service
3133 gcp_environment : main
3234
4749 echo ${{ steps.get-deployment-info.outputs.gcp_resource_affix }}
4850 echo ${{ steps.get-deployment-info.outputs.gcp_service_name }}
4951 echo ${{ steps.get-deployment-info.outputs.version }}
52+
53+ - uses : nick-fields/assert-action@v1
54+ with :
55+ expected : europe-west6-docker.pkg.dev/my-test-project/my-affix/my-test-service:-latest
56+ actual : ${{ steps.get-deployment-info.outputs.image_latest_artefact }}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ outputs:
3535 image_latest_tag :
3636 description : " The tag of the latest docker image."
3737 image_version_artefact :
38- description : " The artefact URI for the docker image for the version to deploy."
38+ description : " The artefact URI for the docker image for the version to deploy."
3939 image_version_tag :
4040 description : " The tag of the docker image for the version."
4141 short_sha :
You can’t perform that action at this time.
0 commit comments