Skip to content

Commit

Permalink
ci: add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Impeqq committed Jan 6, 2025
1 parent c943a66 commit eefbab1
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Messenger

on:
push:
branches:
- main
- features/**
- dependabot/**
- master
pull_request:
branches:
- main

jobs:
docker:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
include:
- dockerfile: ./frontend/Dockerfile
context: ./frontend
image: ghcr.io/Impeqq/web
- dockerfile: ./backend/Dockerfile
context: ./backend
image: ghcr.io/Impeqq/api

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ matrix.image }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Run Docker Compose
run: docker compose up -d

0 comments on commit eefbab1

Please sign in to comment.