Simplify repository workflows
Use deploy workflow for staging, too
This commit is contained in:
parent
e5216c6c5f
commit
f90d1e0667
2 changed files with 41 additions and 56 deletions
48
.github/workflows/deploy.yml
vendored
48
.github/workflows/deploy.yml
vendored
|
@ -1,15 +1,49 @@
|
|||
name: Deploy (Production)
|
||||
name: Deploy
|
||||
|
||||
on: workflow_dispatch
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
hostname:
|
||||
description: Hostname
|
||||
type: string
|
||||
required: true
|
||||
default: antville.org
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
stage:
|
||||
runs-on: antville
|
||||
|
||||
environment:
|
||||
name: antville.org
|
||||
url: https://antville.org
|
||||
name: production
|
||||
url: ${{ inputs.hostname }}
|
||||
|
||||
steps:
|
||||
- name: Copy files to production server
|
||||
run: ssh staging-server deploy-antville
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew :build
|
||||
|
||||
- name: Copy files to server
|
||||
# The rsync command applies the same filters as the one in tools/extras/deploy.sh
|
||||
run: |
|
||||
rsync ./build/install/antville/ ${{ inputs.hostname }}:./apps/antville/ \
|
||||
--archive --compress --delete --verbose \
|
||||
--filter '+ /claustra' \
|
||||
--filter '+ /code' \
|
||||
--filter '+ /compat' \
|
||||
--filter '+ /db' \
|
||||
--filter '+ /i18n' \
|
||||
--filter '+ /lib' \
|
||||
--filter '- /*'
|
||||
rsync ./build/install/antville/static/ ${{ inputs.hostname }}:./apps/antville/static/ \
|
||||
--archive --compress --verbose \
|
||||
--filter '+ /fonts' \
|
||||
--filter '+ /formica.html' \
|
||||
--filter '+ /img' \
|
||||
--filter '+ /scripts' \
|
||||
--filter '+ /styles' \
|
||||
--filter '- /*'
|
||||
|
||||
- name: Restart Helma
|
||||
run: ssh ${{ inputs.hostname }} restart
|
||||
|
||||
|
|
49
.github/workflows/stage.yml
vendored
49
.github/workflows/stage.yml
vendored
|
@ -1,49 +0,0 @@
|
|||
name: Deploy (Staging)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
hostname:
|
||||
description: Hostname
|
||||
type: string
|
||||
required: true
|
||||
default: antville.org
|
||||
|
||||
jobs:
|
||||
stage:
|
||||
runs-on: antville
|
||||
|
||||
environment:
|
||||
name: stage
|
||||
url: ${{ inputs.hostname }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew :build
|
||||
|
||||
- name: Copy files to server
|
||||
# The rsync command applies the same filters as the one in tools/extras/deploy.sh
|
||||
run: |
|
||||
rsync ./build/install/antville/ ${{ inputs.hostname }}:./apps/antville/ \
|
||||
--archive --compress --delete --verbose \
|
||||
--filter '+ /claustra' \
|
||||
--filter '+ /code' \
|
||||
--filter '+ /compat' \
|
||||
--filter '+ /db' \
|
||||
--filter '+ /i18n' \
|
||||
--filter '+ /lib' \
|
||||
--filter '- /*'
|
||||
rsync ./build/install/antville/static/ ${{ inputs.hostname }}:./apps/antville/static/ \
|
||||
--archive --compress --verbose \
|
||||
--filter '+ /fonts' \
|
||||
--filter '+ /formica.html' \
|
||||
--filter '+ /img' \
|
||||
--filter '+ /scripts' \
|
||||
--filter '+ /styles' \
|
||||
--filter '- /*'
|
||||
|
||||
- name: Restart Helma
|
||||
run: ssh ${{ inputs.hostname }} restart
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue