Skip to content

Create hcp-packer.yml #1

Create hcp-packer.yml

Create hcp-packer.yml #1

Workflow file for this run

name: hcp-packer

Check failure on line 1 in .github/workflows/hcp-packer.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/hcp-packer.yml

Invalid workflow file

`on.workflow_run` does not reference any workflows. See https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows#workflow_run for more information
on:
push:
branches:
- "master"
- "develop/**"
- "releases/**"
- "features/**"
pull_request:
branches: ["master", "staging"]
workflow_run:
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 }}"