forked from hotosm/tasking-manager
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
89 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- osm-ita | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout GitHub Action' | ||
uses: actions/checkout@main | ||
|
||
- name: 'Login to GitHub Container Registry' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.actor}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
- name: Set output | ||
id: vars | ||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
- name: 'Build Backend Image' | ||
env: | ||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | ||
run: | | ||
docker build . -f ./scripts/docker/Dockerfile.backend --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$GITHUB_SHA --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$RELEASE_VERSION | ||
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$GITHUB_SHA | ||
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$RELEASE_VERSION | ||
- name: 'Build Frontend Image' | ||
env: | ||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | ||
FRONTEND_ENV: ${{ vars.FRONTEND_ENV }} | ||
run: | | ||
echo "$FRONTEND_ENV" > tasking-manager.env | ||
docker build . -f ./scripts/docker/Dockerfile.frontend --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$GITHUB_SHA --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$RELEASE_VERSION | ||
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$GITHUB_SHA | ||
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$RELEASE_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# To use this file, run `docker-compose up`. | ||
version: '3.4' | ||
|
||
x-backend-config: &backend | ||
build: | ||
context: "." | ||
dockerfile: "./scripts/docker/Dockerfile.backend" | ||
|
||
services: | ||
# Main application | ||
backend: | ||
<<: *backend | ||
volumes: | ||
- .:/usr/src/app | ||
labels: | ||
- traefik.http.routers.backend.rule=Host(`localhost`) && PathPrefix(`/api/`) | ||
- traefik.http.services.backend.loadbalancer.server.port=5000 | ||
|
||
# Migration service | ||
migration: | ||
<<: *backend | ||
volumes: | ||
- .:/usr/src/app | ||
|
||
frontend: | ||
build: | ||
context: "." | ||
dockerfile: "./scripts/docker/Dockerfile.frontend" | ||
volumes: | ||
- ".:/usr/src/app" | ||
labels: | ||
- traefik.http.routers.frontend.rule=Host(`localhost`) || Host(`127.0.0.1`) | ||
- traefik.http.services.frontend.loadbalancer.server.port=80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters