-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.58 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Create Image
on:
push:
branches:
- main
jobs:
create-image:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v4
- name: Set up Packer
id: setup
uses: hashicorp/setup-packer@main
- name: Packer init
id: init
run: 'packer init .'
- name: Packer fmt check
id: fmt
run: 'packer fmt -check .'
- name: Packer validate
id: validate
run: 'packer validate -syntax-only -evaluate-datasources .'
- name: Export github key
id: export
env:
GITHUB_APP_KEY: ${{secrets.PKR_VAR_github_app_private_key}}
run: 'echo "$GITHUB_APP_KEY" > github-app.pem'
- name: Packer build
env:
PKR_VAR_domain: ${{ secrets.PKR_VAR_domain }}
PKR_VAR_email: ${{ secrets.PKR_VAR_email }}
PKR_VAR_jenkins_user: ${{ secrets.PKR_VAR_jenkins_user }}
PKR_VAR_jenkins_password: ${{ secrets.PKR_VAR_jenkins_password }}
PKR_VAR_docker_hub_username: ${{ secrets.PKR_VAR_docker_hub_username }}
PKR_VAR_docker_hub_password: ${{ secrets.PKR_VAR_docker_hub_password }}
PKR_VAR_github_token: ${{ secrets.PKR_VAR_github_token }}
PKR_VAR_github_app_id: ${{ secrets.PKR_VAR_github_app_id }}
id: build
run: packer build -color=false .