forked from pavlovic-ivan/ephemeral-github-runner-image
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
149478e
commit 7514933
Showing
1 changed file
with
42 additions
and
42 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
# name: Packer Build | ||
name: Packer Build | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# jobs: | ||
# build-gcp: | ||
# runs-on: ubuntu-20.04 | ||
# environment: gcp | ||
# steps: | ||
# - name: Checkout Packer project | ||
# uses: actions/checkout@v3 | ||
jobs: | ||
build-gcp: | ||
runs-on: ubuntu-20.04 | ||
environment: gcp | ||
steps: | ||
- name: Checkout Packer project | ||
uses: actions/checkout@v3 | ||
|
||
# - name: Initialize Packer Plugin Binaries:GCP | ||
# run: packer init ./gcp | ||
- name: Initialize Packer Plugin Binaries:GCP | ||
run: packer init ./gcp | ||
|
||
# - name: Build Image:GCP | ||
# env: | ||
# PKR_VAR_project: ${{ secrets.GOOGLE_PROJECT }} | ||
# GOOGLE_APPLICATION_CREDENTIALS: gcp.json | ||
# run: | | ||
# cat > $GOOGLE_APPLICATION_CREDENTIALS << EOF | ||
# ${{ secrets.GOOGLE_CREDENTIALS }} | ||
# EOF | ||
# trap "rm -f $GOOGLE_APPLICATION_CREDENTIALS" EXIT | ||
# packer build -force -var-file=./gcp/amd64/values.pkrvars.hcl -var "runner_version=$(cat versions.json | jq -r '.runner')" ./gcp | ||
- name: Build Image:GCP | ||
env: | ||
PKR_VAR_project: ${{ secrets.GOOGLE_PROJECT }} | ||
GOOGLE_APPLICATION_CREDENTIALS: gcp.json | ||
run: | | ||
cat > $GOOGLE_APPLICATION_CREDENTIALS << EOF | ||
${{ secrets.GOOGLE_CREDENTIALS }} | ||
EOF | ||
trap "rm -f $GOOGLE_APPLICATION_CREDENTIALS" EXIT | ||
packer build -force -var-file=./gcp/amd64/values.pkrvars.hcl -var "runner_version=$(cat versions.json | jq -r '.runner')" ./gcp | ||
# build-aws: | ||
# runs-on: ubuntu-20.04 | ||
# environment: aws | ||
# strategy: | ||
# matrix: | ||
# aws-region: [us-east-1, us-west-2] | ||
# steps: | ||
# - name: Checkout Packer project | ||
# uses: actions/checkout@v3 | ||
build-aws: | ||
runs-on: ubuntu-20.04 | ||
environment: aws | ||
strategy: | ||
matrix: | ||
aws-region: [us-east-1, us-west-2] | ||
steps: | ||
- name: Checkout Packer project | ||
uses: actions/checkout@v3 | ||
|
||
# - name: Initialize Packer Plugin Binaries:AWS | ||
# run: packer init ./aws | ||
- name: Initialize Packer Plugin Binaries:AWS | ||
run: packer init ./aws | ||
|
||
# - name: Build Image:AWS | ||
# env: | ||
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
# run: | | ||
# packer build -force -var-file=./aws/amd64/values.pkrvars.hcl -var "region=${{ matrix.aws-region }}" -var "runner_version=$(cat versions.json | jq -r '.runner')" ./aws | ||
# packer build -force -var-file=./aws/arm64/values.pkrvars.hcl -var "region=${{ matrix.aws-region }}" -var "runner_version=$(cat versions.json | jq -r '.runner')" ./aws | ||
- name: Build Image:AWS | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
packer build -force -var-file=./aws/amd64/values.pkrvars.hcl -var "region=${{ matrix.aws-region }}" -var "runner_version=$(cat versions.json | jq -r '.runner')" ./aws | ||
packer build -force -var-file=./aws/arm64/values.pkrvars.hcl -var "region=${{ matrix.aws-region }}" -var "runner_version=$(cat versions.json | jq -r '.runner')" ./aws |