Skip to content

feat: ascii art

feat: ascii art #907

Workflow file for this run

name: deploy
permissions:
contents: read
packages: write
on:
push:
branches: main
paths: [src/**, package-lock.json]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
IMAGE_NAME: wouterds/wouterds.com
jobs:
build:
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASS: ${{ github.token }}
COMMIT_SHA: ${{ github.sha }}
steps:
- run: echo "COMMIT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASS }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value=${{ env.COMMIT_SHA }}
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
cache-from: type=gha
cache-to: type=gha,mode=max
file: .docker/Dockerfile
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
VITE_CLOUDFLARE_TURNSTILE_KEY=${{ secrets.VITE_CLOUDFLARE_TURNSTILE_KEY }}
COMMIT_SHA=${{ env.COMMIT_SHA }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: production
url: https://wouterds.com
env:
HOST: ${{ secrets.CLOUDFLARE_TUNNEL }}
USER: code
DIRECTORY: /code/com.wouterds
steps:
- uses: actions/checkout@v4
- run: |
wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- run: |
echo "Host ${{ env.HOST }}" >> ~/.ssh/config
echo " ProxyCommand $(which cloudflared) access ssh --hostname %h" >> ~/.ssh/config
echo " StrictHostKeyChecking no" >> ~/.ssh/config
chmod 600 ~/.ssh/config
- run: |
ssh ${{ env.USER }}@${{ env.HOST }} "mkdir -p ${{ env.DIRECTORY }}"
scp .docker/docker-compose.yml ${{ env.USER }}@${{ env.HOST }}:${{ env.DIRECTORY }}/docker-compose.yml
scp .docker/nginx.conf ${{ env.USER }}@${{ env.HOST }}:${{ env.DIRECTORY }}/nginx.conf
ssh ${{ env.USER }}@${{ env.HOST }} "cd ${{ env.DIRECTORY }} && docker compose pull && docker compose up -d --force-recreate"