-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (48 loc) · 2.19 KB
/
cleanup.yaml
File metadata and controls
60 lines (48 loc) · 2.19 KB
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
57
58
59
60
# This is a basic workflow to help you get started with Actions
name: Cleanup Image
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
PACKER_GITHUB_API_TOKEN: ${{ secrets.GH_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/checkout@v4
- name: Setup HashiCorp Packer
# You may pin to the exact commit or the version.
# uses: hashicorp/setup-packer@1aa358be5cf73883762b302a3a03abd66e75b232
uses: hashicorp/setup-packer@v3.1.0
- name: Download GTag
run: |
curl -sSL https://raw.githubusercontent.com/HappyPathway/centralized-actions/main/gtag.py -o gtag.py
curl -sSL https://raw.githubusercontent.com/HappyPathway/centralized-actions/main/gtag_requirements.txt -o requirements.txt
- name: setup Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
cache: pip
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3.1.2
with:
terraform_version: 1.9.1
cli_config_credentials_token: ${{ secrets.TFE_TOKEN }}
cli_config_credentials_hostname: app.terraform.io
terraform_wrapper: false
- name: terraform init
run: terraform init -upgrade -backend-config="bucket=${{ vars.gcs_state_bucket }}" -backend-config="prefix=${{ vars.gcs_state_key }}"
- name: terraform destroy
run: terraform destroy -auto-approve