diff --git a/.github/workflows/apply.yaml b/.github/workflows/apply.yaml new file mode 100644 index 0000000..7f13901 --- /dev/null +++ b/.github/workflows/apply.yaml @@ -0,0 +1,48 @@ +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 \ No newline at end of file