This repository has been archived by the owner on Mar 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (87 loc) · 2.99 KB
/
ci.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
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
---
name: Build docker image and push AWS Deployment ECS
on:
release:
types: [published, created, edited]
jobs:
push_to_registry:
name: Build and Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Debug dockerfile
run: find . -type f -name Dockerfile
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
driver: docker
- name: Push to GitHub Packages
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
tags: ghcr.io/denzuko/clients/rearc.io
platforms: linux/amd64,linux/arm64,linux/arm
terraform:
name: 'Build Infrastructure'
needs: [push_to_registry]
runs-on: ubuntu-latest
# Use the Bash shell regardless whether the GitHub Actions runner
# is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
# Checkout the repository to the GitHub Actions runner
steps:
- name: Checkout
uses: actions/checkout@v2
# Install the latest version of Terraform CLI and configure
# the Terraform CLI configuration file with a Terraform Cloud
# user API token
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 0.14.8
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
# Initialize a new or existing Terraform working directory by creating
# initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init
with:
terraform_version: 0.14.8
# Checks that all Terraform configuration files adhere
# to a canonical format
- name: Terraform Format
run: terraform fmt -check
with:
terraform_version: 0.14.8
# Generates an execution plan for Terraform
- name: Terraform Plan
run: terraform plan
with:
terraform_version: 0.14.8
env:
TF_VAR__AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret }}
TF_VAR__AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key }}
TF_VAR__AWS_DEFAULT_REGION: ${{ secrets.aws_default_region }}
TF_VAR__image_name: ghcr.io/denzuko/clients/rearc.io:latest
newman:
name: 'Validate deployment'
runs-on: ubuntu-latest
needs: [terraform]
steps:
- uses: actions/checkout@master
- uses: matt-ball/newman-action@master
with:
apiKey: ${{ secrets.postmanApiKey }}
collection: 484495-56c2adc0-0c58-4f36-9c9d-cc0bcc734e10
environment: 484495-51b5f716-8dba-4adb-931a-2eafc13a17f9
...