Update README.md #32
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: Build and Deploy AMI | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
types: [closed] | |
jobs: | |
build_and_deploy_ami: | |
name: Python 2 Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Zip application | |
run: zip -r webapp.zip . | |
- name: Set up Google Cloud SDK | |
uses: google-github-actions/[email protected] | |
with: | |
credentials_json: ${{ secrets.GCP_SA_KEY }} | |
# - name: Check Service Account Key File | |
# run: | | |
# if [ ! -f "${{ github.workspace }}/secrets/project4-414017-5c44874f2950.json" ]; then | |
# echo "Error: Service account key file not found." | |
# exit 1 | |
# fi | |
- name: Check Service Account Key File | |
run: | | |
if [ ! -f "${{ github.workspace }}/secrets/project4-414017-5c44874f2950.json" ]; then | |
echo "Error: Service account key file not found." | |
exit 1 | |
fi | |
- name: Set up environment variables | |
run: | | |
export GOOGLE_APPLICATION_CREDENTIALS=${{ github.workspace }}/secrets/project4-414017-5c44874f2950.json | |
- name: Packer init | |
run: packer init ./packer/centos-stream.pkr.hcl | |
- name: Build AMI | |
run: packer build ./packer/centos-stream.pkr.hcl |