Skip to content

Commit

Permalink
fix mainnet deploy (#2660)
Browse files Browse the repository at this point in the history
  • Loading branch information
yourmoonlight authored Sep 20, 2024
1 parent 0c15e33 commit 115eafa
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/deploy_mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,47 @@ jobs:
deploy-rooch-mainnet:
name: Deploy Rooch Mainnet
runs-on: self-hosted
if: |
github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'release' &&
(github.event.release.prerelease == true || github.event.release.prerelease == false))
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Download Docker tag artifact
if: github.event_name == 'workflow_run'
uses: actions/download-artifact@v4
with:
name: docker_tag
path: .
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GIT_PACKAGE_TOKEN }}

- name: Determine ref
id: determine-ref
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "REF=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
else
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
echo "REF=$(cat docker_tag.txt)" >> $GITHUB_ENV
else
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
REF=${GITHUB_REF#refs/tags/}
elif [[ "${{ github.ref }}" == refs/heads/* ]]; then
REF=${GITHUB_REF#refs/heads/}
fi
echo "REF=$REF" >> $GITHUB_ENV
fi
fi
- name: Print ref
run: echo "The Tag Ref is ${{ env.REF }} and The Branch Ref is ${{ github.ref }}"

- name: Deploy to GCP MAINNET VM
env:
PRIVATE_KEY: ${{ secrets.GCP_MAINNET_SSH_PRIVATE_KEY }}
Expand Down

0 comments on commit 115eafa

Please sign in to comment.