We succesfully use the Plesk / Github integration that deploys our developers pushes from github to our plesk stage web server using the Webhooks to have Plesk get the latest version. That works splendidly.
What we try to establish additionally is auto compile the SCSS source and submit the resulting css to our stage web server. We have added an action to the workflow but how would the compiled products end up on our stage webserver. I’m unsure if the timing in the complete workflow is right. Will the actions be performed before deployment?
This is the yaml:
on:
push:
branches:
- stage
jobs:
build_css:
runs-on: ubuntu-latest
steps:
- name: Checkout source Git branch
uses: actions/checkout@v2
with:
ref: stage
fetch-depth: 10
submodules: true
- name: Make destination directory for compiled CSS
run: mkdir -vp /tmp/theme/assets/
- name: Compile CSS from SCSS files
uses: gha-utilities/[email protected]
with:
source: assets/src/main.scss
destination: /tmp/theme/assets/
- name: Move compiled CSS to path within stage branch
run: mv /tmp/theme/assets assets/
2
Answers
The GitHub Actions configuration that you have posted will perform the steps on a runner only. It will not make changes to the repository.
To answer your question: The actions will not be performed before the deployment.
I assume that Plesk can somehow access the latest state of the repository. If you wanted Plesk to access the compiled CSS, one way to do it is to add another step to the pipeline. This would be a step where the compiled files are committed to the repository, typically by a bot or service account. You’d have to set this up yourself.
Example commands for the step (pseudo-code only):
Please note this may not be the best approach in general but it could help you to achieve what you want.
You can do this via Plesk, through its "Additional Deployment Actions" tab. Check the Enable Additional Deployment Actions section in the Plesk documentation regarding remote Git hosting:
In essence, you could enter your build commands in the additional deploy actions section in Plesk:
(Note: I’ve simply installed
sass
globally for this example, you may want to adapt this step depending on your usage scenario)