Skip to content

πŸ’š improve workflow #70

πŸ’š improve workflow

πŸ’š improve workflow #70

Workflow file for this run

name: Deploy
on:
push:
branches:
- main-2024
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Set deployment environment variables based on Git branches
id: deploy_target
run: |
if [[ $GITHUB_REF == 'refs/heads/dev' ]]; then
echo "DEPLOY_TARGET=sites/staging.associationgrand.ch" >> $GITHUB_ENV
fi
if [[ $GITHUB_REF == 'refs/heads/main-2024' ]]; then
echo "DEPLOY_TARGET=sites/associationgrand.ch" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Build with astro
run: yarn build
- name: Deploy to Server
uses: burnett01/[email protected]
with:
switches: -avzr --delete
path: dist/
remote_path: ${{ env.DEPLOY_TARGET }}
remote_host: "ig7dp.ftp.infomaniak.com"
remote_user: "ig7dp_antistatique"
remote_key: ${{ secrets.PRIVATE_SSH_KEY }}