testing 18F deploy action #4
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: Deploy to Cloud.gov dev | |
on: | |
push: | |
# using current branch to test | |
branches: [ jvd/next-deploy ] | |
# paths: | |
# - 'nextjs/nextjs-site/**' | |
jobs: | |
build: | |
name: Build Nextjs app | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install node dependencies | |
working-directory: nextjs/nextjs-site | |
run: npm install | |
- name: Run tests | |
working-directory: nextjs/nextjs-site | |
run: npm run build | |
deploy: | |
name: Deploy to Cloud.gov dev | |
runs-on: ubuntu-latest | |
needs: build | |
environment: dev | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Deploy app | |
# using 18F action instead of cloud-cli-tools | |
# because we need support for working-directory | |
uses: 18F/cg-deploy-action@main | |
with: | |
app_directory: './nextjs/nextjs-site' | |
cf_org: ${{ vars.CF_ORG }} | |
cf_space: ${{ vars.CF_SPACE }} | |
cf_username: ${{ secrets.CF_USERNAME }} | |
cf_password: ${{ secrets.CF_PASSWORD }} |