-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (65 loc) · 2.18 KB
/
deploy.yaml
File metadata and controls
80 lines (65 loc) · 2.18 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
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Deploy to GitHub Container Registry
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'pyproject.toml'
permissions:
contents: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4.0.0
with:
package_json_file: 'frontend/package.json'
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: 'frontend/.nvmrc'
registry-url: https://npm.pkg.github.com/
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name : Install dependencies
run: make reqs-ci
- name: Check formatting
run: make check-format-ci
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }}
- name: Get version
id: get_version
run: |
VERSION=$(uv version --short)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Build frontend
run: |
make build-frontend-ci
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/cdmserver:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/cdmserver:latest
- name: Log out from GitHub Container Registry
run: docker logout ghcr.io
- name: Create and push git tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git tag ${{ steps.get_version.outputs.VERSION }}
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git ${{ steps.get_version.outputs.VERSION }}