Skip to content

Commit f4f2929

Browse files
authored
MRG: Merge pull request #2 from octue/devops/fix-release-workflow
Fix release workflow
2 parents 5ef4bf5 + 8ce38aa commit f4f2929

File tree

4 files changed

+50
-5
lines changed

4 files changed

+50
-5
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
uses: docker/[email protected]
32+
with:
33+
context: .
34+
push: true
35+
tags: octue/get-deployment-info:${{ github.event.inputs.tag }}

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v3
1717

18+
- name: Install poetry
19+
uses: snok/[email protected]
20+
1821
- name: Get package version
1922
id: get-package-version
2023
run: echo "PACKAGE_VERSION=$(poetry version -s)" >> $GITHUB_OUTPUT

.github/workflows/test.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: test-deployment-info
22

33
on:
4-
push:
4+
pull_request:
5+
branches:
6+
- main
57

68
jobs:
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

@@ -47,3 +49,8 @@ jobs:
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 }}

action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)