Skip to content

migrate-self-hosted #37

migrate-self-hosted

migrate-self-hosted #37

# This workflow will upload the code for the lambda-jumpbox-uptime to the S3 bucket called "lexd-solutions-lambdas"
name: CI for Lambda to S3 for Jumpbox Uptime
on:
push:
branches: [ main ]
paths:
- 'wordpress/3-app-configuration/lambda-jumpbox-uptime/src/**'
pull_request:
branches: [ main ]
paths:
- 'wordpress/3-app-configuration/lambda-jumpbox-uptime/src/**'
# Allows workflow to run manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
# To use this repository's private action,
# must first check out the repository
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_GITHUB_ACTIONS_ROLE_ARN }}
aws-region: ap-southeast-2
- name: zip main.py in src/ to current workspace dir and upload to S3
run: |
CURRENT_DIR=$(pwd)
mkdir artifact
cd ./wordpress/3-app-configuration/lambda-jumpbox-uptime/src/
zip "${CURRENT_DIR}/artifact/lambda-jumpbox-uptime.zip" main.py
aws s3 cp "${CURRENT_DIR}/artifact/lambda-jumpbox-uptime.zip" s3://lexd-solutions-lambdas/lambda-jumpbox-uptime.zip