This repository has been archived by the owner on Dec 13, 2024. It is now read-only.
PATCH: Fix case when there's no html_url key #9
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: Lambda zendesk-backup Deploy | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- lambda_/zendesk_backup/** | |
workflow_dispatch: | |
permissions: | |
id-token: write # This is required for requesting the JWT for AWS authentication | |
contents: read # This is required for actions/checkout | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
max-parallel: 1 | |
fail-fast: true | |
matrix: | |
include: | |
- environment: staging | |
- environment: production | |
environment: | |
name: ${{ matrix.environment }} | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: hashicorp/setup-terraform@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Build ZIP file | |
run: | | |
ls -lah | |
bash build.sh | |
working-directory: lambda_/zendesk_backup/ | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
role-session-name: ${{ github.run_id }}-${{ github.event_name }}-${{ github.job }} | |
aws-region: ${{ vars.AWS_REGION }} | |
- name: Test AWS access | |
run: | | |
aws sts get-caller-identity | |
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. | |
- name: Terraform Init | |
run: terraform init | |
working-directory: lambda_/zendesk_backup/ | |
# Checks that all Terraform configuration files adhere to a canonical format | |
- name: Terraform Format | |
run: terraform fmt -check | |
working-directory: lambda_/zendesk_backup/ | |
# Generates an execution plan for Terraform | |
- name: Terraform Apply | |
run: | | |
terraform apply -auto-approve \ | |
-input=false \ | |
-var="staging_iam_role=${{ secrets.STAGING_IAM_ROLE }}" \ | |
-var="production_iam_role=${{ secrets.PRODUCTION_IAM_ROLE }}" | |
env: | |
TF_WORKSPACE: ${{ matrix.environment }} | |
working-directory: lambda_/zendesk_backup/ |