Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Dec 15, 2023
1 parent 6f3c18b commit 9b9c4a2
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions .github/workflows/rivet-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
ns_name: ${{ steps.derive_names.outputs.ns_name }}
version_name: ${{ steps.derive_names.outputs.version_name }}
steps:
- name: Checkout code
- name: Checkout
uses: actions/checkout@v2

- name: Set up Rivet CLI
Expand All @@ -31,59 +31,74 @@ jobs:
echo "::set-output name=version_name::$version_name"
- name: Create Namespace
env:
RIVET_API_ENDPOINT: "https://api.staging2.gameinc.io"
RIVET_TOKEN: ${{ secrets.RIVET_TOKEN }}
run: |
rivet namespace create --id "${{ steps.derive_names.outputs.ns_name }}" --name "$branch_name" --version "0.0.1" || true
buid-job-matchmaker:
build_job_matchmaker:
needs: prepare
runs-on: ubuntu-20.04
outputs:
image_id: ${{ steps.build_image.outputs.image_id }}
env:
RIVET_API_ENDPOINT: "https://api.staging2.gameinc.io"
RIVET_TOKEN: ${{ secrets.RIVET_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Rivet CLI
run: |
export RIVET_CLI_VERSION="0.3.1"
curl -fsSL https://raw.githubusercontent.com/rivet-gg/cli/main/install/unix.sh | sh
- name: Build Docker
- name: Build Docker Image
id: build_image
run: |
output=$(rivet image build-push --format json --name '${{ needs.prepare.outputs.ns_name }}' --dockerfile 'Dockerfile')
echo "::set-output name=image_id::$(echo $output | jq -r '.image_id')"
id: build-docker
build-cdn:
build_cdn:
needs: prepare
runs-on: ubuntu-20.04
outputs:
site_id: ${{ steps.build_cdn.outputs.site_id }}
env:
RIVET_API_ENDPOINT: "https://api.staging2.gameinc.io"
RIVET_TOKEN: ${{ secrets.RIVET_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Rivet CLI
run: |
export RIVET_CLI_VERSION="0.3.1"
curl -fsSL https://raw.githubusercontent.com/rivet-gg/cli/main/install/unix.sh | sh
- name: Build CDN
id: build_cdn
run: |
output=$(rivet site build-push --format json --dockerfile Dockerfile --name '${{ needs.prepare.outputs.ns_name }}' --command 'yarn run build' --path 'dist')
output=$(rivet site build-push --format json --dockerfile Dockerfile --name '${{ needs.prepare.outputs.ns_name }}' --command 'yarn run build' --path 'yarn run build')
echo "::set-output name=site_id::$(echo $output | jq -r '.site_id')"
id: build-cdn
deploy-version:
needs: [__NEEDS__]
needs: [build-docker, build-cdn]
deploy:
needs: [prepare, build_job_matchmaker, build_cdn]
runs-on: ubuntu-20.04
env:
RIVET_API_ENDPOINT: "https://api.staging2.gameinc.io"
RIVET_TOKEN: ${{ secrets.RIVET_CLOUD_TOKEN }}
RIVET_TOKEN: ${{ secrets.RIVET_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Rivet CLI
run: |
export RIVET_CLI_VERSION="0.3.1"
curl -fsSL https://raw.githubusercontent.com/rivet-gg/cli/main/install/unix.sh | sh
- name: Deploy Version
run: |
rivet deploy --namespace '${{ needs.prepare.outputs.ns_name }}' --override 'matchmaker.docker.image_id="${{ needs.buid-job-matchmaker.outputs.image_id }}"' --override 'cdn.site_id="${{ needs.build-cdn.outputs.site_id }}"'
rivet deploy --namespace '${{ needs.prepare.outputs.ns_name }}' --name '${{ needs.prepare.outputs.version_name}}' --override 'matchmaker.docker.image_id="${{ needs.build_job_matchmaker.outputs.image_id }}"' --override 'cdn.site_id="${{ needs.build_cdn.outputs.site_id }}"'

0 comments on commit 9b9c4a2

Please sign in to comment.