-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
888ac53
commit 81b5b8f
Showing
2 changed files
with
82 additions
and
79 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 |
---|---|---|
@@ -1,64 +1,65 @@ | ||
name: Deploy to development | ||
|
||
on: | ||
workflow_dispatch | ||
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' | ||
- 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 }} | ||
- 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 | ||
platforms: linux/arm64 | ||
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 | ||
platforms: linux/arm64 | ||
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 | ||
- 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 |
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