-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (65 loc) · 2.03 KB
/
deploy-dev.yml
File metadata and controls
67 lines (65 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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 up QEMU
uses: docker/setup-qemu-action@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