Closed maggie44 closed 1 year ago
@klutchell, it seems ${{ github.event.pull_request.head.sha }}
isn't available inside the action.yml to specify a container. Here is an alternative way. Bit of a shame to have to have a test action.yml, would rather they used the same file but it's still pretty close.
Ideas welcome. Particularly on whether there is a better way to integrate the test into Flowzone rather than have it sitting below as an additional job (which works fine, but if there is a custom test option for Flowzone, may as well use it as intended).
I was thinking part of your custom Flowzone action would be to use sed to replace the image string in the existing action.yml
before running the action.
eg.
run: |
sed -r 's|(image: docker://ghcr\.io/balena-io/deploy-to-balena-action:).+$|\1${{ github.event.pull_request.head.sha }} \
-i action.yml
I think then it would need to commit that change to be able to access the action.yml file to be able to do the test deploy? Could have a look to see if we can reference a local action.yml without having to commit it, but was aiming to keep it as close to how it deploys normally.
We definitely don't want to commit the change, you should be able to call a local action with uses: ./action.yml
eg. https://github.com/product-os/flowzone/blob/master/.github/workflows/tests.yml#L17
uses: ./action.yml
Didn't seem to like specifying the action.yml, but specifying the context ./
works ok, finding the action.yml as its default.
uses: ./action.yml
Didn't seem to like specifying the action.yml, but specifying the context
./
works ok, finding the action.yml as its default.
Maybe using the full .yml path only works for reusable workflows. Either way, what you have seems to be correct!
lgtm
Adds a deploy to Cloud test to run after Flowzone completes.
The test:
action.yml
to tell it to point to the docker image built by Flowzone in the build step before.