Skip to content

Commit

Permalink
ci: fix deploy-teztnet workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
johnyob committed Mar 12, 2024
1 parent 58c5f2d commit 532a500
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/deploy-teztnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@ jobs:
- name: Download network config
run: |
curl -s https://teztnets.com/teztnets.json | \
jq -r 'to_entries[] | select(.value.human_name | test("${{ github.event.inputs.network }}"; "i")) >> \
network.json
jq -r "to_entries[] | select(.value.human_name | test(\"${{ inputs.network }}\"; \"i\"))" > network.json
- name: Extract NETWORK
id: network
run: |
NETWORK=$(jq -r '.key' network.json | tr -d '\n')
NETWORK=$(jq -r ".key" network.json | tr -d '\n')
echo "NETWORK=${NETWORK}" >> $GITHUB_ENV
- name: Extract OCTEZ_TAG
id: octez-tag
run: |
OCTEZ_TAG=$(jq -r '.value.octez_tag' network.json | \
OCTEZ_TAG=$(jq -r ".value.octez_tag" network.json | \
grep -oP "master_[0-9a-f]{8}_[0-9a-f]{14}" | \
uniq | \
tr -d '\n')
tr -d "\n")
echo "OCTEZ_TAG=${OCTEZ_TAG}" >> $GITHUB_ENV
fund-operator:
Expand All @@ -43,9 +42,9 @@ jobs:
- name: Install get-tez
run: npm install @tacoinfra/get-tez
- run: |
npx @tacoinfra/get-tez ${{ secrets.JSTZ_ROLLUP_OPERATOR_ADDRESS }} \
npx @tacoinfra/get-tez "${{ secrets.JSTZ_ROLLUP_OPERATOR_ADDRESS }}" \
--amount 10100 \
--network ${{ github.event.inputs.network }}
--network "${{ inputs.network }}"
build-kernel:
name: Build (Kernel)
Expand All @@ -61,7 +60,7 @@ jobs:
id: upload-kernel
uses: actions/upload-artifact@v4
with:
name: jstz_kernel
name: jstz-kernel
path: target/wasm32-unknown-unknown/release/jstz_kernel.wasm

build-docker:
Expand All @@ -79,20 +78,22 @@ jobs:
- name: Deploy rollup
run: |
ROLLUP_ADDRESS=$(docker run -v "/var/run/docker.sock":"/var/run/docker.sock" \
-e NETWORK=${{ needs.download-teztnet-config.outputs.network }} -e OPERATOR_SK=${{ secrets.JSTZ_ROLLUP_OPERATOR_SK }} \
-e NETWORK="${{ needs.download-teztnet-config.outputs.network }}" \
-e OPERATOR_SK="${{ secrets.JSTZ_ROLLUP_OPERATOR_SK }}" \
-e OPERATOR_ADDRESS="${{ secrets.JSTZ_ROLLUP_OPERATOR_ADDRESS }}" \
${{ needs.build-docker.outputs.jstz-rollup }} \
deploy |
grep -oE "sr1[a-zA-Z0-9]{33}" |
uniq |
tr -d '\n')
tr -d "\n")
echo "ROLLUP_ADDRESS=${ROLLUP_ADDRESS}" >> $GITHUB_ENV
- name: Create GitHub deployment
uses: altinukshini/deployment-action@releases/v1
id: deployment
with:
token: "${{ github.token }}"
environment: ${{ github.event.inputs.network }}
environment: ${{ inputs.network }}

- name: Update deployment status
uses: altinukshini/deployment-status@releases/v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-weeklynet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ jobs:
deploy:
name: Deploy to weeklynet
uses: ./.github/workflows/deploy-teztnet.yml
secrets: inherit
with:
network: weeklynet
3 changes: 2 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ jobs:
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/${{ matrix.image }}
sep-tags: " "
tags: |
type=schedule,pattern={{date 'YYYYMMDD'}}
- # Extract tags for jstz
run: echo "tag=${{ fromJson(steps.meta.outputs.json).tags[0] }}" >> $GITHUB_OUTPUT
id: jstz-cli-tag
Expand Down

0 comments on commit 532a500

Please sign in to comment.