mirror of
https://github.com/JuLi0n21/pwa-player.git
synced 2026-04-19 23:40:05 +00:00
chatgpt fix workflow :clueless:
This commit is contained in:
51
.github/workflows/osumusic.yml
vendored
51
.github/workflows/osumusic.yml
vendored
@@ -2,8 +2,7 @@ name: Docker Build and Push
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [main]
|
||||||
- main
|
|
||||||
paths:
|
paths:
|
||||||
- 'proxy/**'
|
- 'proxy/**'
|
||||||
- 'frontend/**'
|
- 'frontend/**'
|
||||||
@@ -17,29 +16,12 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-backend:
|
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
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Install protoc and plugins
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Install protoc
|
|
||||||
run: |
|
run: |
|
||||||
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip
|
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip
|
||||||
unzip protoc-21.12-linux-x86_64.zip -d protoc3
|
unzip protoc-21.12-linux-x86_64.zip -d protoc3
|
||||||
@@ -47,8 +29,6 @@ jobs:
|
|||||||
sudo mv protoc3/include/* /usr/local/include/
|
sudo mv protoc3/include/* /usr/local/include/
|
||||||
rm -rf protoc-21.12-linux-x86_64.zip protoc3
|
rm -rf protoc-21.12-linux-x86_64.zip protoc3
|
||||||
|
|
||||||
- name: Install protoc-gen plugins
|
|
||||||
run: |
|
|
||||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||||
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
|
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
|
||||||
@@ -68,29 +48,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Build osu-server binary
|
- name: Build osu-server binary
|
||||||
working-directory: grpc-backend
|
working-directory: grpc-backend
|
||||||
run: |
|
run: go build -o osu-server .
|
||||||
go build -o osu-server .
|
|
||||||
|
|
||||||
- name: Upload osu-server binary artifact
|
- name: Upload osu-server binary
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: osu-server
|
name: osu-server
|
||||||
path: grpc-backend/osu-server
|
path: grpc-backend/osu-server
|
||||||
|
|
||||||
build-proxy:
|
build-proxy:
|
||||||
needs: build-backend
|
|
||||||
runs-on: ubuntu-latest
|
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:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
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
|
||||||
@@ -99,8 +70,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
|
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
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 Proxy Docker image
|
- name: Push Proxy Docker image
|
||||||
run: |
|
run: |
|
||||||
@@ -108,19 +78,11 @@ jobs:
|
|||||||
docker push juli0n21/proxy-container:latest
|
docker push juli0n21/proxy-container:latest
|
||||||
|
|
||||||
build-frontend:
|
build-frontend:
|
||||||
needs: build-backend
|
|
||||||
runs-on: ubuntu-latest
|
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:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
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
|
||||||
@@ -129,8 +91,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
|
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
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 Frontend Docker image
|
- name: Push Frontend Docker image
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user