Skip to content

ci: deploy to staging hetzner #20

ci: deploy to staging hetzner

ci: deploy to staging hetzner #20

Workflow file for this run

name: Next Application Build, Push, and Deploy
on:
push:
branches:
- "main"
- "support-pali-v1-backward-compatibility"
workflow_dispatch: # Manual trigger
jobs:
docker:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/syscoin/syscoin-bridge
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Save metadata
uses: actions/upload-artifact@v4
with:
name: metadata
path: metadata.json
deploy-staging-hetzner:
if: ${{ github.event_name == 'workflow_dispatch' }}
needs: docker
runs-on: ubuntu-latest
steps:
- name: Download metadata
uses: actions/download-artifact@v4
with:
name: metadata
path: ./metadata
- name: Read Metadata
id: read-metadata
run: |
cd metadata
meta=$(cat metadata.json)
echo "::set-output name=tags::$(echo "$meta" | jq -r '.target["docker-metadata-action"].tags | join(",")')"
shell: bash
- name: Deploy Frontend Service
uses: appleboy/[email protected]
with:
host: ${{ secrets.HETZNER_STAGING_HOST }}
username: root
key: ${{ secrets.HETZNER_SSH_KEY }}
script: |

Check failure on line 83 in .github/workflows/ghcr.yaml

View workflow run for this annotation

GitHub Actions / Next Application Build, Push, and Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/ghcr.yaml (Line: 83, Col: 19): Unexpected symbol: '|'. Located at position 34 within expression: steps.read-metadata.outputs.tags | split(',')[0]
export FRONTEND_IMAGE="${{ steps.read-metadata.outputs.tags | split(',')[0] }}"
cd /root/bridge
docker-compose pull frontend
docker-compose up -d frontend