Skip to content

Docker image deploy

Docker image deploy #3

Workflow file for this run

name: Docker image deploy
on:
push:
branches:
- main
paths:
- "backend/**"
workflow_dispatch:
inputs:
tag:
description: 'Docker image tag'
required: true
default: 'latest'
jobs:
docker-deploy:
name: Docker deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Builder
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: |
cd backend/
INPUT_TAG=${{ github.event.inputs.tag }}
TAG=${INPUT_TAG:-"latest"}
docker build -t ghcr.io/flatironinstitute/stan-wasm-server:$TAG .
docker push ghcr.io/flatironinstitute/stan-wasm-server:$TAG
- name: Ping public server to restart
run: |
curl -X POST https://stan-wasm.flatironinstitute.org/restart -H "Authorization: Bearer ${{ secrets.PUBLIC_SERVER_RESTART_TOKEN }}"