Skip to content

Deploy to space

Deploy to space #9

#
# To manually trigger:
# gh workflow run --ref jadudm/tf-0103 --field environment=dev deploy-to-dev.yaml
#
name: Deploy to space
on:
# push:
# branches:
# - jadudm/tf-0103
workflow_dispatch:
inputs:
environment:
required: true
type: string
workflow_call:
inputs:
environment:
required: true
type: string
jobs:
deploy:
name: apply ( ${{ inputs.environment }} )
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
env:
KEY: "terraform.tfstate.${{ inputs.environment }}"
TF_VAR_cf_user: ${{ secrets.CF_USERNAME }}
TF_VAR_cf_password: ${{ secrets.CF_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install CloudFoundry CLI v8
run: |
curl -k -O -L https://github.com/cloudfoundry/cli/releases/download/v8.8.0/cf8-cli-installer_8.8.0_x86-64.deb
sudo apt-get install --assume-yes ./cf8-cli-installer_8.8.0_x86-64.deb
# This may want to become TF actions
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.10.3"
- name: Authenticate against Cloud.gov
run: |

Check failure on line 44 in .github/workflows/deploy-to-dev.yaml

View workflow run for this annotation

GitHub Actions / Deploy to space

Invalid workflow file

The workflow is not valid. .github/workflows/deploy-to-dev.yaml (Line: 44, Col: 14): Unrecognized named-value: 'dev'. Located at position 1 within expression: dev.CF_ORG
cf api api.fr.cloud.gov
cf auth ${{ secrets.CF_USERNAME }} ${{ secrets.CF_PASSWORD }}
cf target -o ${{ dev.CF_ORG }} -s ${{ dev.CF_SPACE }} \
--environment ${{ environment.CF_ORG }} \
--stacked ${{ environment.dev.CF_ORG }} \
--bare $CF_ORG
- name: Run `make dev` (terraform init -> plan -> apply)
run: |
pushd ${GITHUB_WORKSPACE}/terraform
make dev
popd