diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5ca908..7b30a15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 + aws-region: us-west-2 - name: Build, tag, and push the image to Amazon ECR id: build-image @@ -54,3 +54,14 @@ jobs: docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" + + - name: Packer build + uses: ExitoLab/packer_build_action_aws@v0.2.10 + with: + templateFile: 'packer/config.json' + workingDir: '.' + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: us-west-2 + LEC_VERSION: ${{ steps.version.outputs.new_tag }} diff --git a/packer/settings.pkr.json b/packer/config.json similarity index 89% rename from packer/settings.pkr.json rename to packer/config.json index a3f1c63..256506b 100644 --- a/packer/settings.pkr.json +++ b/packer/config.json @@ -2,13 +2,14 @@ "variables": { "aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}", "aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}", - "aws_region": "us-west-2" + "aws_region": "us-west-2", + "lec_version": "{{env `LEC_VERSION`}}" }, "builders": [ { "access_key": "{{user `aws_access_key`}}", "secret_key": "{{user `aws_secret_key`}}", - "ami_name": "log-export-container", + "ami_name": "log-export-container@{{user `lec_version`}}", "instance_type": "t2.micro", "region": "{{user `aws_region`}}", "source_ami_filter": {