forked from Filemarket-xyz/mark3d
-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (52 loc) · 2.45 KB
/
auth.yml
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
name: MAIN AUTH CI
on:
push:
branches:
- "main"
jobs:
check-changes:
runs-on: [ self-hosted, main ]
outputs:
proto_changes: ${{ steps.check_changes.outputs.proto_changed }}
auth_changes: ${{ steps.check_changes.outputs.auth_changed }}
steps:
- uses: actions/checkout@v3
- name: save changes
id: check_changes
run: |
echo "proto_changed=$(./is_changed.sh auth_fm_proto proto)" >> $GITHUB_OUTPUT
echo "auth_changed=$(./is_changed.sh auth_fm_server authserver)" >> $GITHUB_OUTPUT
build-auth-server:
runs-on: [ self-hosted, main ]
needs: [ check-changes ]
steps:
- uses: actions/checkout@v3
- name: Copy .env from host
if: ${{ needs.check-changes.outputs.proto_changes == 'true' || needs.check-changes.outputs.auth_changes == 'true' }}
run: cp ~/.auth_indexer_main_env authserver/.env
- name: Build proto
if: ${{ needs.check-changes.outputs.proto_changes == 'true' || needs.check-changes.outputs.auth_changes == 'true' }}
run: make proto
working-directory: authserver/
- name: Build auth container
if: ${{ needs.check-changes.outputs.proto_changes == 'true' || needs.check-changes.outputs.auth_changes == 'true' }}
run: docker build --build-arg env=main -t file-market-auth-service:latest .
working-directory: authserver/
update:
runs-on: [ self-hosted, main ]
needs: [ check-changes, build-auth-server ]
steps:
- uses: actions/checkout@v3
- name: Up migration
if: ${{ needs.check-changes.outputs.proto_changes == 'true' || needs.check-changes.outputs.auth_changes == 'true' }}
run: docker-compose -f docker-compose.auth.yml up -d --build auth-indexer-postgres-migration
- name: Check migration status
if: ${{ needs.check-changes.outputs.proto_changes == 'true' || needs.check-changes.outputs.auth_changes == 'true' }}
run: ./check_auth_migration.sh
- name: Update compose
if: ${{ needs.check-changes.outputs.proto_changes == 'true' || needs.check-changes.outputs.auth_changes == 'true' }}
run: docker-compose -f docker-compose.auth.yml up -d auth-indexer-service
- name: Set changes
run: |
redis-cli set auth_fm_proto_hash "$(find proto -type f -print0 | sort -z | xargs -0 sha1sum | sha1sum)"
redis-cli set auth_fm_server_hash "$(find authserver -type f -print0 | sort -z | xargs -0 sha1sum | sha1sum)"