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 Action to deploy #2206

Draft
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Nov 28, 2024

Today we use GitHub Actions to build and deploy using Jenkins. This implements a deployment using GitHub Actions so we use a single environment.

The design is to build the website just like we do in CI, but then set up SSH for rsync followed by the actual rsync.

It introduces 3 secrets that are intended to be set as environment secrets:

  • SSH_PRIVATE_KEY
  • SSH_KNOWN_HOSTS
  • DEPLOY_TARGET

Link: https://docs.github.com/en/actions/use-cases-and-examples/deploying/deploying-with-github-actions

Today we use GitHub Actions to build and deploy using Jenkins. This
implements a deployment using GitHub Actions so we use a single
environment.

The design is to build the website just like we do in CI, but then set
up SSH for rsync followed by the actual rsync.

It introduces 3 secrets that are intended to be set as environment
secrets:

* `SSH_PRIVATE_KEY`
* `SSH_KNOWN_HOSTS`
* `DEPLOY_TARGET`

Link: https://docs.github.com/en/actions/use-cases-and-examples/deploying/deploying-with-github-actions
- name: Copy files
run: rsync --log-file "${rsync_log}" --log-file-format 'CHANGED %f' --archive --checksum --verbose --one-file-system --compress --stats --delete-after ./_site/ ${{ secrets.DEPLOY_TARGET }}
- name: Purge CDN
run: awk '/ CHANGED /{print $5}' "${rsync_log}" | xargs --no-run-if-empty fastly-purge 'https://theforeman.org/'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fastly-purge is not present now so moving to draft.

@evgeni
Copy link
Member

evgeni commented Dec 5, 2024

Today this won't work, as we limit who is allowed to deploy the website:
https://github.com/theforeman/foreman-infra/blob/7c342ff6b6c9cb3462b21b3c8747cfe80f2de325/puppet/modules/web/manifests/vhost/web.pp#L92-L96

Not saying we should not change that, just that this requires more work, which I personally don't have the time for right now.

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.

2 participants