-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
27 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,10 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version_output: ${{ steps.version_output.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
|
@@ -25,7 +26,7 @@ jobs: | |
persist-credentials: false | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker Meta | ||
id: meta | ||
|
@@ -57,16 +58,10 @@ jobs: | |
name: docker-image | ||
path: /tmp/artifacts/myimage.tar | ||
|
||
- name: Create Version Artifact | ||
- name: Create Version output | ||
run: | | ||
echo "${{ steps.meta.outputs.Version }}" > version.txt | ||
id: create_artifact | ||
|
||
- name: Upload Version Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: version-artifact | ||
path: version.txt | ||
echo "versions=${{ steps.meta.outputs.Version }}" >> "$GITHUB_OUTPUT" | ||
id: version_output | ||
|
||
k8s-tests: | ||
runs-on: ubuntu-latest | ||
|
@@ -80,8 +75,10 @@ jobs: | |
path: artifacts | ||
|
||
- name: Read version into env var | ||
env: | ||
version: ${{ needs.build.outputs.version_output }} | ||
run: | | ||
echo "version_tag=$(cat artifacts/version.txt)" >> $GITHUB_ENV | ||
echo "version_tag=${{ version }}" >> $GITHUB_ENV | ||
echo "Extracted version tag: $version_tag" | ||
- name: Checkout repository | ||
|
@@ -103,21 +100,23 @@ jobs: | |
- name: Load image | ||
run: | | ||
docker load --input /tmp/artifacts/myimage.tar | ||
docker tag hirosystems/stacks-devnet-api:$version_tag hirosystems/stacks-devnet-api:latest | ||
docker tag hirosystems/stacks-devnet-api:$version_tag hirosystems/stacks-devnet-api:ci | ||
docker image ls -a | ||
- run: k3d image import hirosystems/stacks-devnet-api:latest -c k3d-kube | ||
- run: kubectl create namespace devnet | ||
- run: kubectl create configmap stacks-devnet-api-conf --from-file=./Config.toml --namespace devnet | ||
- run: kubectl apply -f ./templates/ci/stacks-devnet-api.template.yaml | ||
|
||
- name: Sleep for 30 seconds | ||
run: sleep 30s | ||
shell: bash | ||
|
||
- run: kubectl get all --all-namespaces | ||
- run: kubectl -n devnet get cm | ||
- run: kubectl -n devnet describe po stacks-devnet-api | ||
- name: Deploy k8s manifests | ||
run: | | ||
k3d image import hirosystems/stacks-devnet-api:ci -c k3d-kube | ||
kubectl create namespace devnet | ||
kubectl create configmap stacks-devnet-api-conf --from-file=./Config.toml --namespace devnet | ||
kubectl apply -f ./templates/ci/stacks-devnet-api.template.yaml | ||
echo "sleep for 30 sec" | ||
sleep 30 | ||
- name: Sanity check on k8s resources deployed | ||
run: | | ||
kubectl get all --all-namespaces | ||
kubectl -n devnet get cm | ||
kubectl -n devnet describe po stacks-devnet-api | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
|
@@ -164,7 +163,7 @@ jobs: | |
[email protected] | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker Meta | ||
id: meta | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM rust:bullseye as builder | ||
FROM rust:bookworm as builder | ||
WORKDIR /src | ||
COPY . /src | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters