Skip to content

Initial POC: Django + Vue 3 + Inertia.js webapp for devopsdays.org #1

Initial POC: Django + Vue 3 + Inertia.js webapp for devopsdays.org

Initial POC: Django + Vue 3 + Inertia.js webapp for devopsdays.org #1

Workflow file for this run

name: Build & Deploy
on:
push:
branches: [main]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: devopsdays/devopsdays-web-app
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.prod
push: true
tags: |
ghcr.io/devopsdays/devopsdays-web-app:latest
ghcr.io/devopsdays/devopsdays-web-app:${{ github.sha }}
deploy:
needs: build-and-push
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy to EC2
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.EC2_HOST }}
username: ec2-user
key: ${{ secrets.EC2_SSH_KEY }}
script: |
cd /opt/devopsdays-web-app
docker pull ghcr.io/devopsdays/devopsdays-web-app:latest
docker compose -f docker-compose.prod.yml up -d --force-recreate web
echo "Deploy complete!"