Add github workflow #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build infra | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
env: | |
HOME: ./temp_home | |
jobs: | |
build: | |
name: Build infrastructure | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
path: ${{ env.SRC_PREFIX }} | |
- name: Install Doppler CLI | |
run: | | |
sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl gnupg | |
curl -sLf --retry 3 --tlsv1.2 --proto "=https" 'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key' | sudo gpg --dearmor -o /usr/share/keyrings/doppler-archive-keyring.gpg | |
echo "deb [signed-by=/usr/share/keyrings/doppler-archive-keyring.gpg] https://packages.doppler.com/public/cli/deb/debian any-version main" | sudo tee /etc/apt/sources.list.d/doppler-cli.list | |
sudo apt-get update && sudo apt-get install doppler | |
- name: Setup Doppler | |
working-directory: ./oracle | |
env: | |
DOPPLER_ACESS_TOKEN: ${{ secrets.DOPPLER_ACCESS_TOKEN }} | |
run: | | |
mkdir temp_home | |
doppler setup --no-interactive -t ${{ secrets.DOPPLER_ACCESS_TOKEN }} | |
- name: Install Terraform CLI | |
uses: hashicorp/setup-terraform@v2 | |
with: | |
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} | |
- name: Run Terraform | |
working-directory: ./oracle | |
env: | |
TF_API_TOKEN: ${{ secrets.TF_API_TOKEN }} | |
run: | | |
./scripts/apply_terraform.sh |