Dieses Tutorial führt dich durch den Prozess der automatischen Bereitstellung einer Webanwendung über FTP mithilfe von GitHub Actions. Durch das Befolgen dieser Schritte kannst du einen kontinuierlichen Bereitstellungsworkflow einrichten, der Webanwendungsdateien automatisch auf einen FTP-Server überträgt, sobald Änderungen im jeweiligen GitHub-Repository vorgenommen werden.
Ich habe Webhosting 2000 benutzt, aber jedes andere netcup Webhosting-Angebot sollte ebenfalls funktionieren.
Wenn du ein Webhosting-Paket von netcup bestellst, bekommst du zusätzlich Zugriff auf das Webhosting Control Panel.
Jetzt fügen wir die erstellten Zugangsdaten dem GitHub Repository hinzu.
name: FTP Deployment
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Deploy over FTP
uses: SamKirkland/FTP-Deploy-Action@3.2.0
with:
server: -server-
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
server-dir: /path/to/destination/folder
local-dir: ./path/to/local/folder
Mit Hilfe dieses Tutorials hast du erfolgreich einen automatischen Bereitstellungsworkflow unter Verwendung von GitHub Actions erstellt. Von nun an werden alle Änderungen am "main branch" des Repositorys automatisch über eine FTP-Verbindung auf die Dateien auf deinem Server angewendet. Die Bereitstellung deiner Webapp ist ab jetzt sehr viel zeitsparender, da du dich nicht mehr jedes Mal anmelden und deine Dateien hochladen musst.
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
By making a contribution to this project, I certify that:
The contribution was created in whole or in part by me and I have the right to submit it under the licence indicated in the file; or
The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate licence and I have the right under that licence to submit that work with modifications, whether created in whole or in part by me, under the same licence (unless I am permitted to submit under a different licence), as indicated in the file; or
The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the licence(s) involved.