Repository navigation
47 lines (39 loc) · 1.5 KB
/
Copy pathmain.yml
File metadata and controls
47 lines (39 loc) · 1.5 KB
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
name: Deploy to S3
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
deploy:
environment: live
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
repository: mitre/cti
path: mitre-cti
- uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: 'x64'
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
- name: Build static site
run: |
cd cti-generator/
python -m pip install -r requirements.txt
python main.py
cd ../
- name: Copy files using the AWS CLI
run: |
aws s3 cp js/ s3://tbat.app/js/ --recursive --acl public-read --cache-control "public, max-age=86400"
aws s3 cp cti/ s3://tbat.app/cti/ --recursive --acl public-read --cache-control "public, max-age=86400"
aws s3 cp css/ s3://tbat.app/css/ --recursive --acl public-read --cache-control "public, max-age=86400"
aws s3 cp index.html s3://tbat.app/index.html --acl public-read --cache-control "public, max-age=1800"