mirror of
https://github.com/fluencelabs/dashboard
synced 2024-12-04 15:20:21 +00:00
split deployment and build statges
This commit is contained in:
parent
34e48a5021
commit
62417a8b86
@ -4,23 +4,11 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
### extract branch name
|
||||
- name: Extract branch name
|
||||
if: github.event_name != 'pull_request'
|
||||
shell: bash
|
||||
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
|
||||
id: extract_branch
|
||||
|
||||
- name: Extract branch name
|
||||
if: github.event_name == 'pull_request'
|
||||
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js 14
|
||||
@ -72,13 +60,9 @@ jobs:
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
|
||||
### Deploy
|
||||
- name: Deploy dashboard@master to DigitalOcean via SSH
|
||||
uses: appleboy/ssh-action@v0.1.3
|
||||
- name: Invoke deployment workflow
|
||||
uses: benc-uk/workflow-dispatch@v1
|
||||
with:
|
||||
HOST: ${{ secrets.DASHBOARD_HOST }}
|
||||
USERNAME: ${{ secrets.DASHBOARD_USERNAME }}
|
||||
KEY: ${{ secrets.DASHBOARD_SSHKEY }}
|
||||
script: |
|
||||
docker pull fluencelabs/dashboard:${{ env.VERSION }}
|
||||
docker rm -f dashboard
|
||||
docker run -d --name dashboard -p443:443 -p80:80 -v caddy_data:/data fluencelabs/dashboard:${{ env.VERSION }}
|
||||
workflow: Some Workflow
|
||||
token: ${{ secrets.PERSONAL_TOKEN }}
|
||||
inputs: '{ "version": ${{ env.VERSION }} }'
|
28
.github/workflows/deploy.yml
vendored
Normal file
28
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
name: build and deploy prod
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version of docker container to deploy"
|
||||
required: false
|
||||
default: 'latest'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
### Set version
|
||||
- run: echo "CONTAINER_TAG=fluencelabs/dashboard:${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
||||
|
||||
### Deploy
|
||||
- name: Deploy dashboard@master to DigitalOcean via SSH
|
||||
uses: appleboy/ssh-action@v0.1.3
|
||||
with:
|
||||
HOST: ${{ secrets.DASHBOARD_HOST }}
|
||||
USERNAME: ${{ secrets.DASHBOARD_USERNAME }}
|
||||
KEY: ${{ secrets.DASHBOARD_SSHKEY }}
|
||||
script: |
|
||||
docker pull ${{ env.CONTAINER_TAG }}
|
||||
docker rm -f dashboard
|
||||
docker run -d --name dashboard -p443:443 -p80:80 -v caddy_data:/data ${{ env.CONTAINER_TAG }}
|
Loading…
Reference in New Issue
Block a user