Skip to content

Test variable access #77

Test variable access

Test variable access #77

Workflow file for this run

name: Deploy Site
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-and-deploy:
name: Build and deploy
environment: Staging
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Build app
run: npm run build
- name: Install Ansible
shell: bash
run: |
sudo apt update
sudo apt install -y ansible
- name: Load deploy key
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
# - name: Set server key
# env:
# SERVER_KEYS: ${{env.SERVER_PUBLIC_KEYS}}
# run: |
# mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts
# echo $SERVER_KEYS >> ~/.ssh/known_hosts
- name: Set server key
env:
SERVER_KEYS: ${{env.SERVER_PUBLIC_KEYS}}
run: |
echo $SERVER_KEYS
- name: Run playbook
run: |
cd $GITHUB_WORKSPACE
ansible-playbook -i 'beta.thesociallions.nl', .playbook/playbook.yml -u github-actions --extra-vars "repositoryPath=dist/"