-
Notifications
You must be signed in to change notification settings - Fork 13
34 lines (34 loc) · 1.36 KB
/
main.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
name: Build and deploy to S3
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v2
- name: Setup SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
- name: Build and Publish binaries
run: dotnet build -c Release
- name: Publish Windows
run: dotnet publish S2AN.sln -r win-x64 -c Release -o ./publish/windows --self-contained true -p:PublishSingleFile=true
- name: Publish Linux
run: dotnet publish S2AN.sln -r linux-x64 -c Release -o ./publish/linux --self-contained true -p:PublishSingleFile=true
- 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-central-1
- name: Delete files in S3 bucket
run: aws s3 rm s3://s2an.3coresec.net --recursive --exclude "index.html"
- name: Copy files to S3 bucket
run: aws s3 cp publish s3://s2an.3coresec.net/ --recursive --exclude "*.pdb"
- name: Create invalidation on CloudFront
run: aws cloudfront create-invalidation --distribution-id E30C99TWH423J8 --paths "/*"