Skip to content

Commit

Permalink
Fix a race condtion with git and workflow (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-persson authored Nov 27, 2023
1 parent f3e2de8 commit 9201ffb
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,8 @@ jobs:
docker push $IMAGE_ID:$VERSION
echo $IMAGE_ID:$VERSION
echo "::set-output name=version::$VERSION"
- name: Update manifests
uses: fjogeleit/yaml-update-action@main
with:
valueFile: 'manifests/base/api/deployment.yaml'
propertyPath: 'spec.template.spec.containers[0].image'
value: registry.nordix.org/eiffel/etos-environment-provider:${{ steps.image.outputs.version }}
branch: main
commitChange: true
message: Updating API manifest image to version ${{ steps.image.outputs.version }}
outputs:
apiVersion: ${{ steps.image.outputs.version }}
build_worker:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -71,12 +64,26 @@ jobs:
docker push $IMAGE_ID:$VERSION
echo $IMAGE_ID:$VERSION
echo "::set-output name=version::$VERSION"
outputs:
workerVersion: ${{ steps.image.outputs.version }}
update_manifests:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
needs: [build_api, build_worker]
steps:
- uses: actions/checkout@v3
- name: Update manifests
uses: fjogeleit/yaml-update-action@main
with:
valueFile: 'manifests/base/worker/deployment.yaml'
propertyPath: 'spec.template.spec.containers[0].image'
value: registry.nordix.org/eiffel/etos-environment-provider-worker:${{ steps.image.outputs.version }}
changes: |
{
"manifests/base/worker/deployment.yaml": {
"spec.template.spec.containers[0].image": "registry.nordix.org/eiffel/etos-environment-provider-worker:${{ needs.build_worker.outputs.workerVersion }}"
},
"manifests/base/api/deployment.yaml": {
"spec.template.spec.containers[0].image": "registry.nordix.org/eiffel/etos-environment-provider:${{ needs.build_api.outputs.apiVersion }}"
}
}
branch: main
commitChange: true
message: Updating SSE manifest image to version ${{ steps.image.outputs.version }}
message: Updating worker image to ${{ needs.build_worker.outputs.workerVersion }} and API image to ${{ needs.build_api.outputs.apiVersion }}

0 comments on commit 9201ffb

Please sign in to comment.