diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml new file mode 100644 index 00000000..e8f641e7 --- /dev/null +++ b/.github/workflows/beta.yml @@ -0,0 +1,50 @@ +name: Build and Deploy Beta Hugo Site with Nix + +on: + push: + branches: + - beta + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code with submodules + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + + - name: Install Nix + run: | + curl -L https://nixos.org/nix/install | sh + source /home/runner/.nix-profile/etc/profile.d/nix.sh + mkdir -p /home/runner/.config/nix/ + echo "experimental-features = nix-command flakes" >> /home/runner/.config/nix/nix.conf + + - name: Build Hugo Site + run: | + source /home/runner/.nix-profile/etc/profile.d/nix.sh + nix develop --extra-experimental-features nix-command --command website + + - name: Set directory permissions for FTP Deploy + run: | + chmod -R 755 result/ + + - name: Deploy to FTP server + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 + with: + server: ${{ secrets.FTP_SERVER }} + username: ${{ secrets.FTP_USERNAME_BETA }} + password: ${{ secrets.FTP_PASSWORD_BETA }} + local-dir: result/ + server-dir: website/ + state-name: ../.ftp-deploy-sync-state.json + protocol: ftps + security: strict + exclude: | + **/kaffeepause/** + **/scss/main.css + **/scss/main.css.map + diff --git a/README.md b/README.md index 62ecd74a..5402c6f4 100644 --- a/README.md +++ b/README.md @@ -91,3 +91,5 @@ If the result folder is not accessible, try: Even if required, these steps should only need to be used once, and may have just been a quirk of my (Alice) set up. +## CI/CD Pipelin +The website is built and deployed via GitHub Actions workflows. Therefore, any push to the main branch will trigger a rebuild of the website. Instead, please open a pull request for anything other than small content updates. If you are working on something larger than that, you can merge/push to the /beta branch, which will build and deploy to https://beta.rosenpass.eu where you can test your output before trying to merge into the main branch. \ No newline at end of file