-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.4 KB
/
hello-world.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI-CD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
opta-deploy-staging:
name: Deploy Staging
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
env:
working-directory: ./hello-world
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup ssh
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DEPLOYER_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.DEPLOYER_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Build image
working-directory: ${{ env.working-directory }}
run: docker build -t app:${{ github.sha }} -f Dockerfile .
- name: Update deployment
working-directory: ${{ env.working-directory }}
shell: bash
run: |
VERSION=0.11.18 /bin/bash -c "$(curl -fsSL https://docs.runx.dev/install.sh)"
~/.opta/opta deploy --image app:${{ github.sha }} --env staging --auto-approve