mirror of
https://github.com/JuLi0n21/pwa-player.git
synced 2026-04-19 23:40:05 +00:00
update the build only places required
This commit is contained in:
63
.github/workflows/osumusic.yml
vendored
63
.github/workflows/osumusic.yml
vendored
@@ -7,15 +7,28 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- 'proxy/**'
|
- 'proxy/**'
|
||||||
- 'frontend/**'
|
- 'frontend/**'
|
||||||
|
- 'grpc-backend/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'proxy/**'
|
- 'proxy/**'
|
||||||
- 'frontend/**'
|
- 'frontend/**'
|
||||||
|
- 'grpc-backend/**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-backend:
|
||||||
|
if: |
|
||||||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
|
contains(github.event.head_commit.message, 'grpc-backend') ||
|
||||||
|
github.event_name == 'pull_request' && (
|
||||||
|
contains(github.event.pull_request.changed_files, 'grpc-backend')
|
||||||
|
) ||
|
||||||
|
github.event_name == 'push' && (
|
||||||
|
contains(github.event.head_commit.message, 'grpc-backend')
|
||||||
|
)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
osu-server-path: grpc-backend/osu-server
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -61,13 +74,53 @@ jobs:
|
|||||||
- name: Upload osu-server binary artifact
|
- name: Upload osu-server binary artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: osu-server-binary
|
name: osu-server
|
||||||
path: osu-server
|
path: grpc-backend/osu-server
|
||||||
|
|
||||||
|
build-proxy:
|
||||||
|
needs: build-backend
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, 'proxy') || github.event.pull_request.changed_files && contains(join(github.event.pull_request.changed_files, ' '), 'proxy/')
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Download osu-server artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: osu-server
|
||||||
|
path: grpc-backend
|
||||||
|
|
||||||
- name: Build Proxy Docker image
|
- name: Build Proxy Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build -t juli0n21/proxy-container:latest -t juli0n21/proxy-container:${{ github.sha }} ./proxy
|
docker build -t juli0n21/proxy-container:latest -t juli0n21/proxy-container:${{ github.sha }} ./proxy
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
env:
|
||||||
|
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
|
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
echo "${DOCKER_HUB_TOKEN}" | docker login -u "${DOCKER_HUB_USERNAME}" --password-stdin
|
||||||
|
|
||||||
|
- name: Push Proxy Docker image
|
||||||
|
run: |
|
||||||
|
docker push juli0n21/proxy-container:${{ github.sha }}
|
||||||
|
docker push juli0n21/proxy-container:latest
|
||||||
|
|
||||||
|
build-frontend:
|
||||||
|
needs: build-backend
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, 'frontend') || github.event.pull_request.changed_files && contains(join(github.event.pull_request.changed_files, ' '), 'frontend/')
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Download osu-server artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: osu-server
|
||||||
|
path: grpc-backend
|
||||||
|
|
||||||
- name: Build Frontend Docker image
|
- name: Build Frontend Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build -t juli0n21/frontend-container:latest -t juli0n21/frontend-container:${{ github.sha }} ./frontend
|
docker build -t juli0n21/frontend-container:latest -t juli0n21/frontend-container:${{ github.sha }} ./frontend
|
||||||
@@ -79,9 +132,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "${DOCKER_HUB_TOKEN}" | docker login -u "${DOCKER_HUB_USERNAME}" --password-stdin
|
echo "${DOCKER_HUB_TOKEN}" | docker login -u "${DOCKER_HUB_USERNAME}" --password-stdin
|
||||||
|
|
||||||
- name: Push Docker image
|
- name: Push Frontend Docker image
|
||||||
run: |
|
run: |
|
||||||
docker push juli0n21/proxy-container:${{ github.sha }}
|
|
||||||
docker push juli0n21/proxy-container:latest
|
|
||||||
docker push juli0n21/frontend-container:${{ github.sha }}
|
docker push juli0n21/frontend-container:${{ github.sha }}
|
||||||
docker push juli0n21/frontend-container:latest
|
docker push juli0n21/frontend-container:latest
|
||||||
Reference in New Issue
Block a user