-
Notifications
You must be signed in to change notification settings - Fork 1
128 lines (102 loc) · 3.51 KB
/
release.yaml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Release
on:
push:
branches: ['main']
tags: ['v*']
concurrency:
group: '${{ github.workflow }} @ ${{ github.ref }}'
cancel-in-progress: false
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# Disable Terraform telemetry
CHECKPOINT_DISABLE: "true"
permissions:
id-token: write # Required for aws-actions/configure-aws-credentials
contents: read # Required for actions/checkout
jobs:
docker:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
provenance: mode=max
sbom: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
terraform:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::803205869942:role/github-actions-aredn-cloud-tunnel
aws-region: us-east-1
- name: Terraform Init
run: cd infra && terraform init
- name: Place secret variables
run: |
echo "${TFVARS}" | base64 -d > infra/variables.tfvars
env:
TFVARS: ${{ secrets.TFVARS }}
- name: Terraform Destroy
run: cd infra && terraform destroy -no-color -auto-approve -var-file=variables.tfvars
terraform-gcp:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::803205869942:role/github-actions-aredn-cloud-tunnel
aws-region: us-east-1
- name: Configure GCP Credentials
uses: google-github-actions/auth@v2.1.8
with:
create_credentials_file: 'true'
workload_identity_provider: 'projects/820302097205/locations/global/workloadIdentityPools/aredn-cloud-tunnel-gcp/providers/github'
service_account: 'oidc-service-account@supernode-401805.iam.gserviceaccount.com'
- name: Terraform Init
run: cd infra-gcp && terraform init
- name: Place secret variables
run: |
echo "${TFVARS}" | base64 -d > infra-gcp/variables.tfvars
env:
TFVARS: ${{ secrets.GCP_TFVARS }}
- name: Terraform Destroy
run: cd infra-gcp && terraform destroy -no-color -auto-approve -var-file=variables.tfvars