Initial services workflow #10
Workflow file for this run
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' | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
infrastructure: | |
name: 'Infrastructure' | |
runs-on: ubuntu-latest | |
# Checkout the repository to the GitHub Actions runner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token | |
- uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: "1.1.7" | |
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} | |
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. | |
- name: Terraform Init | |
working-directory: 'infrastructure' | |
run: terraform init | |
# Checks that all Terraform configuration files adhere to a canonical format | |
- name: Terraform Format | |
working-directory: 'infrastructure' | |
run: terraform fmt -check | |
# Run Plan | |
- name: Terraform Plan | |
working-directory: 'infrastructure' | |
run: terraform plan | |
services: | |
name: 'Serverless' | |
needs: infrastructure | |
runs-on: ubuntu-latest | |
# Required for Github-AWS OIDC to work | |
permissions: | |
id-token: write | |
contents: read | |
# Checkout the repository to the GitHub Actions runner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Configure AWS Credentials | |
# Basically run 'aws configure' as you would from local CLI | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::633025216388:role/GithubActions-Fairbanksio-F5oclock | |
role-duration-seconds: 1200 # Optional duration, 20 minutes in this case |