Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Actions Workflow Example #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

huntharo
Copy link

  • Here is a GitHub Actions example, if you are interested in providing the example

@zoellner
Copy link
Owner

Thank you for the contribution. I think adding the Github Actions Example is a good idea. Just wondering how this would work exactly for someone who wants to use the Github Action to deploy into their own AWS Account. Would they need to fork the repo and manually configure a few settings?
How can I prevent the action from being triggered in this main repo?

@huntharo
Copy link
Author

huntharo commented Nov 29, 2021

Note: this action is setup to build only but not deploy anything by default (so if run in zoellner/sharp-heic-lambda-layer it will only do a compile then discard the results). I figured that might be desired so that it can be used to test that the code does indeed compile while not exposing the artifact to anyone.

We can comment out the on push / on pr triggers and make the action manually invokable using the workflow_dispatch: {} trigger. I'll update that now.

I'd have to read up a bit on whether actions can be invoked in a fork using secrets in the fork... I think they can. This issue gives some examples of how to make the deploy step invoke only when the secret is populated (it does require reading the secret into an env var within the step):

actions/runner#520

Here is what I did:

  • Private fork without reference (git clone --bare, git remote add myorigin, git push --mirror myorigin, then git clone my private repo)
  • Add the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to my repo
  • Set SAM_BUCKET in .github/workflows/ci.yml to point to my S3 bucket for SAM artifacts

I may be able to change SAM_BUCKET to read from a secret into an env var so it publishing to one's own AWS account can be configured entirely through secrets and without code changes.

@maxcan
Copy link

maxcan commented Oct 31, 2022

@huntharo have you gotten this to build on github actions? the build process seems to be redhat style (yum install..) and changing to apt-get and ubuntu style package names still gets tons of build errors.

@huntharo
Copy link
Author

huntharo commented Nov 4, 2022

@huntharo have you gotten this to build on github actions? the build process seems to be redhat style (yum install..) and changing to apt-get and ubuntu style package names still gets tons of build errors.

Yeah it built when I submitted this PR. I've built it a couple of times... you weren't able to build it work the workflow in this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants