Caprover Deploy branch:caprover-production #62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Caprover Deploy | |
run-name: Caprover Deploy branch:${{ github.ref_name }} | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: | |
- master | |
- development | |
- caprover-* | |
paths: | |
- Dockerfile | |
- erddap/**/* | |
- .github/workflows/* | |
- init.d/* | |
workflow_dispatch: | |
jobs: | |
# Single deploy job since we're just deploying | |
deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
environment: | |
name: ${{ startsWith(github.ref_name, 'caprover-deploy') && 'development' || github.ref_name == 'development' && 'development' || github.ref_name == 'master' && 'production' || github.ref_name == 'caprover-production' && 'production' || 'production' }} | |
url: ${{ vars.URL }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Compress repo to a tar file step | |
run: tar -cvf packaged.tar . | |
- name: Install Caprover CLI | |
run: npm install -g caprover | |
- name: Deploy ${{ github.ref_name }} on ${{ vars.URL }} | |
run: | | |
caprover deploy \ | |
--caproverUrl ${{ vars.CAPROVER_URL }} \ | |
--caproverApp ${{ vars.CAPROVER_APP_NAME }} \ | |
--appToken ${{ secrets.CAPROVER_TOKEN }} \ | |
--tarFile packaged.tar |