Skip to content

Cinema time Docker Image CI #14

Cinema time Docker Image CI

Cinema time Docker Image CI #14

name: Cinema time Docker Image CI
on:
# push:
# branches: ["master"]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
build-args: "DATABASE_URL=${{ secrets.DATABASE_URL }}"
context: .
push: true
tags: ghcr.io/${{ github.repository }}:latest
- name: ssh into server at home
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
docker pull ghcr.io/${{ github.repository }}:latest
docker compose down
docker compose up -d
docker container prune
docker images prune