diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml new file mode 100644 index 0000000..f06a9fe --- /dev/null +++ b/.github/workflows/manual-deploy.yml @@ -0,0 +1,65 @@ +name: Manual Deploy + +on: + workflow_dispatch: + +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: true + 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 }}" }' 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