Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Add packer step in release workflow (#96)
Browse files Browse the repository at this point in the history
Co-authored-by: wallrony <[email protected]>
  • Loading branch information
vassalo and wallrony committed May 19, 2022
1 parent 6348d40 commit 5aa252f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
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 }}
5 changes: 3 additions & 2 deletions packer/settings.pkr.json → packer/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 5aa252f

Please sign in to comment.