Sha256: cb92ef2fb5b82b6ceb36852881e111c8613a7e49c0096594f6cc5e69200744bd

Contents?: true

Size: 1.82 KB

Versions: 2

Compression:

Stored size: 1.82 KB

Contents

name: Deploy Staging

on:
  push:
    branches: [ main ]
    paths-ignore:
      - 'doc/**'
      - 'README.md'

jobs:
  deploy:
    name: Deploy to staging
    runs-on: ubuntu-latest
    environment: staging
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 2
      <% if terraform? %>
      - name: Check for changes to Terraform
        id: changed-terraform-files
        uses: tj-actions/changed-files@v1.1.2
        with:
          files: |
            terraform/shared
            terraform/staging
      - name: Terraform init
        if: steps.changed-terraform-files.outputs.any_changed == 'true'
        working-directory: terraform/staging
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
        run: terraform init
      - name: Terraform apply
        if: steps.changed-terraform-files.outputs.any_changed == 'true'
        working-directory: terraform/staging
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
          TF_VAR_cf_user: ${{ secrets.CF_USERNAME }}
          TF_VAR_cf_password: ${{ secrets.CF_PASSWORD }}
        run: terraform apply -auto-approve -input=false
      <% end %>
      - name: Deploy app
        uses: 18F/cg-deploy-action@main
        env:
          RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
        with:
          cf_username: ${{ secrets.CF_USERNAME }}
          cf_password: ${{ secrets.CF_PASSWORD }}
          cf_org: <%= cloud_gov_organization %>
          cf_space: <%= cloud_gov_staging_space %>
          push_arguments: >-
            --vars-file config/deployment/staging.yml
            --var rails_master_key=$RAILS_MASTER_KEY

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_template_18f-0.8.1 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml.tt
rails_template_18f-0.8.0 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml.tt