build(deps): bump ky from 0.33.3 to 1.2.0 (#305) #82
Workflow file for this run
This file contains 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: RSYNC Deploy | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*.*.*" | |
jobs: | |
env: | |
name: Get deploy environment based on tag suffix | |
runs-on: ubuntu-latest | |
outputs: | |
target-env: ${{ steps.get_environment.outputs.target-env }} | |
steps: | |
- name: 🛒 Checkout | |
uses: actions/checkout@v4 | |
- name: 🚀 Get Environment | |
id: get_environment | |
run: | | |
if [[ ${{ github.ref_name }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo "target-env=production" >> $GITHUB_OUTPUT | |
else | |
echo "target-env=preproduction" >> $GITHUB_OUTPUT | |
fi | |
deploy: | |
needs: env | |
environment: | |
name: ${{ needs.env.outputs.target-env }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🛒 Checkout | |
uses: actions/checkout@v4 | |
- name: ✨ Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: "latest" | |
- name: ✨ Setup NPM | |
uses: bahmutov/npm-install@v1 | |
- name: 🛠️ Build | |
run: hugo | |
- name: 🔑 Install SSH Key | |
run: | | |
install -m 600 -D /dev/null ~/.ssh/id_rsa | |
echo "${{ secrets.RSYNC_PRIVATE_SSH_KEY }}" > ~/.ssh/id_rsa | |
echo "${{ secrets.RSYNC_KNOWN_HOSTS }}" > ~/.ssh/known_hosts | |
- name: 🚀 Deploy | |
run: | | |
echo "Deploying to ${{ needs.env.outputs.target-env }}" >> $GITHUB_STEP_SUMMARY | |
rsync -rpzv --exclude="screenshots" -e 'ssh -p ${{ secrets.RSYNC_REMOTE_PORT }}' './public/' ${{ secrets.RSYNC_REMOTE_USER }}@${{ secrets.RSYNC_REMOTE_HOST }}:${{ secrets.RSYNC_REMOTE_FOLDER }} |