htaccess-deploy #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: htaccess-deploy | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| # Run only if the previous workflow succeeded | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: pipeline | |
| path: pipeline | |
| - name: Set up environment | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y lftp | |
| echo "Running post-build deployment for .htaccess" | |
| cd pipeline | |
| pip install -r requirements.txt | |
| python pipeline/redirect_map.py | |
| - name: Upload .htaccess via SFTP | |
| env: | |
| FTP_SERVER: ${{ secrets.FTP_SERVER }} | |
| SFTP_PORT: ${{ secrets.SFTP_PORT }} | |
| FTP_USER: ${{ secrets.FTP_USER }} | |
| FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }} | |
| run: | | |
| lftp -u "$FTP_USER","$FTP_PASSWORD" -p $SFTP_PORT sftp://$FTP_SERVER <<EOF | |
| lcd pipeline | |
| put .htaccess -o /public_html/.htaccess | |
| bye | |
| EOF |