50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
name: Build and Deploy Docker
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Log in to GHCR
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.rhost.ovh
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./services/php/Dockerfile
|
|
push: true
|
|
tags: git.rhost.ovh/${{ github.repository }}:latest
|
|
deploy:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Deploy via SSH
|
|
uses: appleboy/ssh-action@v1.2.0
|
|
with:
|
|
host: ${{ secrets.SERVER_HOST }}
|
|
port: ${{ secrets.SERVER_PORT }}
|
|
username: ${{ secrets.SERVER_USER }}
|
|
key: ${{ secrets.SERVER_SSH_KEY }}
|
|
script: |
|
|
cd /home/ryjek/docker/portfolio
|
|
docker compose pull
|
|
docker compose up -d
|
|
docker compose exec php ./bin/console importmap:install
|
|
docker compose exec php php bin/console asset-map:compile |