Merge pull request #419 from antville/add-stage-workflow
Add stage workflow
This commit is contained in:
commit
8abb8c8efd
1 changed files with 57 additions and 0 deletions
57
.github/workflows/stage.yml
vendored
Normal file
57
.github/workflows/stage.yml
vendored
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
name: Stage
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch
|
||||||
|
|
||||||
|
env:
|
||||||
|
SSH_AUTH_SOCK: /tmp/ssh-agent.sock
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
install:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
environment:
|
||||||
|
name: stage
|
||||||
|
url: https://antville-test.click
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Java
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 21
|
||||||
|
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v3
|
||||||
|
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew :build
|
||||||
|
|
||||||
|
- name: Set up SSH agent
|
||||||
|
run: |
|
||||||
|
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
|
||||||
|
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo '${{ vars.SSH_CONFIG }}' > ~/.ssh/config
|
||||||
|
echo '${{ vars.KNOWN_HOSTS }}' > ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Publish to staging server
|
||||||
|
run: |
|
||||||
|
rsync build/install/antville/ antville.dev:/apps/antville/ \
|
||||||
|
--dry-run --verbose --archive --delete --compress \
|
||||||
|
--filter '+ /claustra' \
|
||||||
|
--filter '+ /code' \
|
||||||
|
--filter '+ /compat' \
|
||||||
|
--filter '+ /i18n' \
|
||||||
|
--filter '+ /lib' \
|
||||||
|
--filter '- /*'
|
||||||
|
rsync build/install/antville/static/ antville.dev:/apps/antville/static/helma/ \
|
||||||
|
--dry-run --verbose --archive --delete --compress \
|
||||||
|
--filter 'protect /sites' \
|
||||||
|
--filter '+ /*'
|
||||||
|
|
||||||
|
- name: Restart Helma
|
||||||
|
run: ssh antville.dev restart
|
||||||
|
|
Loading…
Add table
Reference in a new issue