Skip to content

Commit

Permalink
Merge branch 'main' into feature/olp-51-add-feedback-button
Browse files Browse the repository at this point in the history
  • Loading branch information
zandemax authored Jul 23, 2023
2 parents a2705de + 92a2fa4 commit 090f5da
Show file tree
Hide file tree
Showing 21 changed files with 669 additions and 517 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Deploy to development

on:
workflow_dispatch

jobs:
set-version:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set version
run: |
sed -i "s/VITE_VERSION=.*/VITE_VERSION=\"${GITHUB_SHA:0:8}\"/" openlineplanner/.env.development
- uses: EndBug/add-and-commit@v9
with:
author_name: Github Actions
author_email: hi@xatellite.space
message: 'Set current version in env file'
build:
permissions:
packages: write
needs: set-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set version
run: |
echo "VERSION=${GITHUB_SHA:0:8}" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push frontend
uses: docker/build-push-action@v4
with:
context: openlineplanner
push: true
tags: ghcr.io/xatellite/openlineplanner/olp-frontend:${{ env.VERSION }}
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: openlineplanner-backend
push: true
tags: ghcr.io/xatellite/openlineplanner/olp-backend:${{ env.VERSION }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Set version
run: |
echo "VERSION=${GITHUB_SHA:0:8}" >> "$GITHUB_ENV"
- name: Trigger pipeline
run: |
curl -vvv -X POST \
--fail \
-F token=${{ secrets.GITLAB_TOKEN }} \
-F "ref=main" \
-F "variables[TEST]=true" \
-F "variables[VERSION]=${VERSION}" \
https://gitlab.com/api/v4/projects/46252495/trigger/pipeline
50 changes: 50 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy to prod

on:
release:
types: [published]

jobs:
build:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set version
run: |
echo "VERSION=$(grep -oP 'VITE_VERSION="\K\d+\.\d+\.\d+' openlineplanner/.env.production)" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push frontend
uses: docker/build-push-action@v4
with:
context: openlineplanner
push: true
tags: ghcr.io/xatellite/openlineplanner/olp-frontend:${{ env.VERSION }}
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: openlineplanner-backend
push: true
tags: ghcr.io/xatellite/openlineplanner/olp-backend:${{ env.VERSION }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Set version
run: |
echo "VERSION=$(grep -oP 'VITE_VERSION="\K\d+\.\d+\.\d+' openlineplanner/.env.production)" >> "$GITHUB_ENV"
- name: Trigger pipeline
run: |
curl -vvv -X POST \
--fail \
-F token=${{ secrets.GITLAB_TOKEN }} \
-F "ref=main" \
-F "variables[TEST]=false" \
-F "variables[VERSION]=${VERSION}" \
https://gitlab.com/api/v4/projects/46252495/trigger/pipeline
1 change: 1 addition & 0 deletions openlineplanner-backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
Loading

0 comments on commit 090f5da

Please sign in to comment.