Update all the things #8
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: Deployment | |
concurrency: live | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: live | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3.0' | |
- name: Setup Tooling | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y webp exiftool pngcrush gzip brotli | |
- name: Build | |
run: | | |
bundle install | |
bundle exec jekyll build | |
bundle exec rake | |
- name: Tailscale | |
uses: tailscale/github-action@v2 | |
with: | |
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
tags: tag:ci | |
- name: Copy To Production | |
run: | | |
mkdir -p ~/.ssh | |
echo "vcsjones-dev ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHEVhpLvozMlKqO8s5pffq0GBV5Ju32kECNzLyU2r4Nv" >> ~/.ssh/known_hosts | |
rsync -a --delete _site/ deployer@vcsjones-dev:/var/wwwroot/vcsjones.com | |
rsync --ignore-times _server/Caddyfile deployer@vcsjones-dev:/etc/caddy/Caddyfile | |
ssh deployer@vcsjones-dev 'sudo systemctl reload caddy.service' |