-
-
Notifications
You must be signed in to change notification settings - Fork 145
78 lines (77 loc) · 2.81 KB
/
docs-workflow.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: re-com.day8.com.au
on:
push:
branches:
- master
jobs:
deploy:
name: Deploy
runs-on: ubuntu-20.04
container:
# Source: https://github.com/day8/dockerfiles-for-dev-ci-images
image: ghcr.io/day8/chrome-56:2
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
steps:
- uses: actions/checkout@v1
- name: Maven cache
id: maven-cache
uses: actions/cache@v1
with:
path: /root/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/project.clj') }}
restore-keys: |
${{ runner.os }}-maven-
- name: npm cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('project.clj') }}-${{ hashFiles('**/deps.cljs') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Run lein deploy-aws
if: steps.maven-cache.outputs.cache-hit != 'true'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_EC2_METADATA_DISABLED: true
run: |
lein deploy-aws
- name: Run lein -o deploy-aws
if: steps.maven-cache.outputs.cache-hit == 'true'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_EC2_METADATA_DISABLED: true
run: |
lein -o deploy-aws
- name: Invalidate CloudFront Distribution
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
PATHS: '/*'
AWS_REGION: 'us-east-1'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Slack notification
uses: homoluctus/slatify@v2.0.1
if: always()
with:
type: ${{ job.status }}
job_name: re-com.day8.com.au Deployment
username: "Github Actions"
channel: '#oss-robots'
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}