Skip to content

fix: update workflow actions #1

fix: update workflow actions

fix: update workflow actions #1

name: Publish Docker image
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
push_to_registry:
name: Push Docker images to GHCR
runs-on: self-hosted
steps:
- name: Check out the repo
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: gd, pdo_pgsql, sodium, curl, intl, mbstring, xml, zip, bcmath
- name: Log in to GitHub Container Registry
id: login-ghcr
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
# All-in-one Image Steps
- name: Extract metadata (tags, labels) for All-in-one Docker
id: meta_all_in_one
uses: docker/metadata-action@v3
with:
images: imantsk/hi.events-all-in-one
- name: Build and push All-in-one Docker image
uses: docker/build-push-action@v3
with:
context: ./
file: ./Dockerfile.all-in-one
push: true
tags: ${{ steps.meta_all_in_one.outputs.tags }}
labels: ${{ steps.meta_all_in_one.outputs.labels }}
# Backend Image Steps
- name: Extract metadata (tags, labels) for Backend Docker
id: meta_backend
uses: docker/metadata-action@v3
with:
images: imantsk/hi.events-backend
- name: Build and push Backend Docker image
uses: docker/build-push-action@v3
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: ${{ steps.meta_backend.outputs.tags }}
labels: ${{ steps.meta_backend.outputs.labels }}
# Frontend Image Steps
- name: Extract metadata (tags, labels) for Frontend Docker
id: meta_frontend
uses: docker/metadata-action@v3
with:
images: imantsk/hi.events-frontend
- name: Build and push Frontend Docker image
uses: docker/build-push-action@v3
with:
context: ./frontend
file: ./frontend/Dockerfile.ssr
push: true
tags: ${{ steps.meta_frontend.outputs.tags }}
labels: ${{ steps.meta_frontend.outputs.labels }}