From 5894a085434f6d67cd401fd17e601446e9228496 Mon Sep 17 00:00:00 2001 From: JoshuaBatty Date: Thu, 26 Jun 2025 12:52:38 +1000 Subject: [PATCH 1/3] chore: add action to update fuelup versions and deploy --- .github/workflows/manual-deploy.yml | 71 +++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/manual-deploy.yml diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml new file mode 100644 index 0000000..ae72ae5 --- /dev/null +++ b/.github/workflows/manual-deploy.yml @@ -0,0 +1,71 @@ +name: Manual Deploy + +on: + workflow_dispatch: + inputs: + force_rebuild: + description: 'Use the latest toolchain version sets from fuelup' + required: true + type: boolean + default: false + +env: + REGISTRY: ghcr.io + +jobs: + build-and-publish-image: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ghcr.io/fuellabs/sway-playground + tags: | + type=sha,prefix= + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the ghcr.io registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push the image to ghcr.io + uses: docker/build-push-action@v3 + with: + context: . + file: deployment/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + no-cache: ${{ github.event.inputs.force_rebuild }} + cache-from: type=gha + cache-to: type=gha,mode=max + + deploy: + needs: build-and-publish-image + runs-on: buildjet-4vcpu-ubuntu-2204 + env: + CONFIG: 'fuel-prod-1' + steps: + - name: Set Environment Variables + run: | + tag=$(echo $GITHUB_SHA | cut -c1-7) + echo "IMAGE_TAG=$tag" >> $GITHUB_ENV + + - name: Deploy Sway Playground Backend Environment + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: Deploy Sway Playground on k8s + repo: FuelLabs/fuel-deployment + ref: refs/heads/master + token: ${{ secrets.REPO_TOKEN }} + inputs: '{ "cluster": "${{ env.CONFIG }}", "deployment-version": "${{ github.sha }}", "image-version": "${{ env.IMAGE_TAG }}" }' From 648bc8b3c12e351de5f8b9620a065bf9568aa619 Mon Sep 17 00:00:00 2001 From: JoshuaBatty Date: Thu, 26 Jun 2025 12:57:17 +1000 Subject: [PATCH 2/3] clean up --- .github/workflows/manual-deploy.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml index ae72ae5..f06a9fe 100644 --- a/.github/workflows/manual-deploy.yml +++ b/.github/workflows/manual-deploy.yml @@ -2,12 +2,6 @@ name: Manual Deploy on: workflow_dispatch: - inputs: - force_rebuild: - description: 'Use the latest toolchain version sets from fuelup' - required: true - type: boolean - default: false env: REGISTRY: ghcr.io @@ -46,7 +40,7 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - no-cache: ${{ github.event.inputs.force_rebuild }} + no-cache: true cache-from: type=gha cache-to: type=gha,mode=max From 1efc954b7770bb669ed13681e5b8d1ede0dd08dd Mon Sep 17 00:00:00 2001 From: JoshuaBatty Date: Thu, 26 Jun 2025 13:10:25 +1000 Subject: [PATCH 3/3] update rust version and use latest commit from charcoal --- deployment/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/Dockerfile b/deployment/Dockerfile index 1af56e3..6bc5576 100644 --- a/deployment/Dockerfile +++ b/deployment/Dockerfile @@ -1,5 +1,5 @@ # Stage 1: Build -FROM lukemathwalker/cargo-chef:latest-rust-1.81 as chef +FROM lukemathwalker/cargo-chef:latest-rust-1.87 as chef WORKDIR /build/ # hadolint ignore=DL3008 @@ -20,7 +20,7 @@ RUN cargo chef prepare --recipe-path recipe.json FROM chef as builder # Install charcoal -RUN cargo install --git https://github.com/ourovoros-io/charcoal.git --rev e69a6ffaf3e7eaf9f3ceea543087ea59ec5fd5d1 +RUN cargo install --git https://github.com/ourovoros-io/charcoal.git ENV CARGO_NET_GIT_FETCH_WITH_CLI=true COPY --from=planner /build/recipe.json recipe.json