Skip to content

Commit

Permalink
Add GitHub Actions (#2)
Browse files Browse the repository at this point in the history
* add raspberry image

* Create hcp-packer.yml

* Update hcp-packer.yml
  • Loading branch information
alexandrelamberty committed Jan 7, 2024
1 parent a4504a4 commit 62ec242
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/hcp-packer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: hcp-packer

on:
push:
branches:
- "master"
- "develop/**"
- "releases/**"
- "features/**"
pull_request:
branches: ["master", "staging"]
workflow_dispatch:

jobs:
hcp-packer:
runs-on: ubuntu-latest
name: Run Packer
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup `packer`
uses: hashicorp/setup-packer@main
id: setup
with:
version: "latest"
- name: Run `packer init`
id: init
run: "packer init ./image.pkr.hcl"
- name: Run `packer validate`
id: validate
run: "packer validate ./image.pkr.hcl"

- name: Build Artifact
run: packer build -color=false -on-error=abort ./image.pkr.hcl
env:
HCP_CLIENT_ID: ${{ secrets.HCP_CLIENT_ID }}
HCP_CLIENT_SECRET: ${{ secrets.HCP_CLIENT_SECRET }}
HCP_PACKER_BUILD_FINGERPRINT: "run.id.${{ github.run_id }}.run.attempt.${{ github.run_attempt }}"
Binary file added raspberry-pi-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 62ec242

Please sign in to comment.