Sha256: fc3c1b5957b153a1c459073a9f68bbdabc112416b60ee30b94b9dea8452361e4

Contents?: true

Size: 1.82 KB

Versions: 13

Compression:

Stored size: 1.82 KB

Contents

name: Deploy Production

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

jobs:
  deploy:
    name: Deploy to production
    runs-on: ubuntu-latest
    environment: production
    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/production
      - name: Terraform init
        if: steps.changed-terraform-files.outputs.any_changed == 'true'
        working-directory: terraform/production
        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/production
        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_production_space %>
          push_arguments: "--vars-file config/deployment/production.yml --var rails_master_key=$RAILS_MASTER_KEY"

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rails_template_18f-0.7.2 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.7.1 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.7.0 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.6.0 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.5.3 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.5.2 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.5.1 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.5.0 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.4.1 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.4.0 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.3.0 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.2.0 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
rails_template_18f-0.1.0 lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt