Generate blueprints #131
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: Generate blueprints | |
on: | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
Generate-files: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install JQ | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y jq | |
- name: Determine latest Core module tag | |
run: | | |
LATEST_TAG=$(curl -s https://api.github.com/repos/dfds/terraform-aws-rds/tags | jq -r '.[0].name') | |
echo "Latest tag: $LATEST_TAG" | |
echo "TAG_NAME=$LATEST_TAG" >> $GITHUB_ENV | |
- name: Download latest Core module | |
run: | | |
curl -L https://github.com/dfds/terraform-aws-rds/archive/refs/tags/${TAG_NAME}.tar.gz > terraform-aws-rds.tar.gz | |
tar -xf terraform-aws-rds.tar.gz ; mv terraform-aws-rds-${TAG_NAME} $GITHUB_WORKSPACE/aws-rds-postgresql/aws-modules-rds | |
shell: bash | |
- name: Build docker image | |
working-directory: aws-rds-postgresql/aws-modules-rds/tools | |
run: | | |
docker build -t scaffold:latest . | |
shell: bash | |
- name: Run script | |
run: | | |
input=$(pwd)/aws-rds-postgresql/aws-modules-rds/ | |
output=$(pwd)/aws-rds-postgresql/generic/ | |
if [ -d $output ]; then | |
rm -rf $output | |
fi | |
mkdir -p $output | |
docker run -v $input:/input -v $output:/output scaffold:latest | |
shell: bash | |
- name: setup git config | |
run: | | |
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
- name: commit | |
run: | | |
git status | |
# Stage the file, commit and push | |
git add $(pwd)/aws-rds-postgresql/generic/ | |
git commit -m "update blueprints for RDS module" | |
git push |