docs: update docs to include badges, authors and license #7
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
# This workflow will validate the Packer AMI templates created using the Hashicorp Configuration Language (HCL2) | |
name: Packer AMI template validation | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [master] | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
environment: ${{ vars.ENVIRONMENT }} | |
name: Validate packer template for the custom AMI | |
steps: | |
- name: Checkout code from branch | |
uses: actions/checkout@v4 | |
- name: Build artifacts | |
run: | | |
zip -r webapp.zip ./ | |
pwd ./webapp | |
- name: Packer variables | |
run: | | |
touch aws/packer/ami.pkrvars.hcl | |
echo ami_prefix=\"${{ vars.AMI_PREFIX }}\" >> ami.pkrvars.hcl | |
echo OS=\"${{ vars.OS }}\" >> ami.pkrvars.hcl | |
echo ubuntu_version=\"${{ vars.VERSION }}\" >> ami.pkrvars.hcl | |
echo ssh_username=\"${{ vars.SSH_USERNAME }}\" >> ami.pkrvars.hcl | |
echo subnet_id=\"${{ secrets.SUBNET_ID }}\" >> ami.pkrvars.hcl | |
echo dev_id=\"${{ secrets.DEV_ID }}\" >> ami.pkrvars.hcl | |
echo prod_id=\"${{ secrets.PROD_ID }}\" >> ami.pkrvars.hcl | |
echo source_ami=\"${{ vars.SOURCE_AMI }}\" >> ami.pkrvars.hcl | |
echo aws_region=\"${{ vars.AWS_REGION }}\" >> ami.pkrvars.hcl | |
echo instance_type=\"${{ vars.INSTANCE_TYPE}}\" >> ami.pkrvars.hcl | |
echo volume_type=\"${{ vars.VOLUME_TYPE}}\" >> ami.pkrvars.hcl | |
echo volume_size=\"${{ vars.VOLUME_SIZE}}\" >> ami.pkrvars.hcl | |
echo device_name=\"${{ vars.DEVICE_NAME}}\" >> ami.pkrvars.hcl | |
cp ami.pkrvars.hcl aws/packer | |
- name: Setup `packer` | |
uses: hashicorp/setup-packer@main | |
id: setup | |
with: | |
version: "latest" | |
- name: Packer init, format and validate template with datasources | |
run: | | |
cd aws/packer && | |
packer fmt . | |
packer init ami.pkr.hcl | |
packer validate -syntax-only --var-file=ami.pkrvars.hcl ami.pkr.hcl | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |