Skip to content

update build-deploy to deploy #1

update build-deploy to deploy

update build-deploy to deploy #1

Workflow file for this run

name: Build
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: true
tags: ghcr.io/rikvoorhaar/blog:latest
deploy:
needs: build
runs-on: [self-hosted, blog-runner]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Pull latest Docker image
run: docker pull ghcr.io/rikvoorhaar/blog:latest
- name: Deploy Containers
run: |
docker compose down
docker compose up -d