File tree Expand file tree Collapse file tree 2 files changed +47
-327
lines changed
Expand file tree Collapse file tree 2 files changed +47
-327
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Deploy VM Image
2+
3+ env :
4+ AWS_REGION : us-east-1 # Replace with your desired AWS region
5+
6+ on :
7+ workflow_dispatch :
8+
9+
10+
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v2
18+
19+ - name : Set up Python
20+ uses : actions/setup-python@v2
21+ with :
22+ python-version : ' 3.8'
23+
24+ - name : Install dependencies
25+ run : |
26+ python -m pip install --upgrade pip
27+ pip install -r requirements.txt
28+
29+ - name : Configure AWS credentials
30+ uses : aws-actions/configure-aws-credentials@v4
31+ with :
32+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY }}
33+ aws-secret-access-key : ${{ secrets.AWS_SECRET }}
34+ aws-region : ${{ env.AWS_REGION }}
35+
36+ - name : Build VM image
37+ run : |
38+ packer fmt -check .
39+ packer init .
40+ packer validate .
41+ packer build -debug .
42+
43+ - name : Deploy VM image
44+ run : |
45+ # Deploy the VM image to your cloud provider
46+ # Example for AWS using AWS CLI
47+ aws ec2 describe-images --filters "Name=name,Values=my-vm-image"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments