58 lines
1.6 KiB
YAML
58 lines
1.6 KiB
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-web:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.PACKAGES_REGISTRY || gitea.server_url }}
|
|
username: ${{ secrets.USERNAME }}
|
|
password: ${{ secrets.TOKEN }}
|
|
|
|
- name: Build and push web image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./web
|
|
file: ./web/Dockerfile
|
|
tags: ${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/web:${{ gitea.ref_name }}
|
|
push: true
|
|
|
|
build-api:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.PACKAGES_REGISTRY || gitea.server_url }}
|
|
username: ${{ secrets.USERNAME }}
|
|
password: ${{ secrets.TOKEN }}
|
|
|
|
- name: Build and push api image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./api
|
|
file: ./api/Dockerfile
|
|
tags: ${{ vars.PACKAGES_REGISTRY || gitea.server_url }}/${{ gitea.repository }}/api:${{ gitea.ref_name }}
|
|
push: true
|