-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.5 KB
/
testing.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
name: Testing
on:
pull_request:
paths:
- .github/workflows/testing.yaml
- Gemfile
- Gemfile.lock
- config.rb
- data/**
- helpers/**
- source/**
issue_comment:
types: [created]
env:
ENV: test
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
#TODO: bring this back to 2.7
ruby-version: '2.6'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: echo $ENV
- name: Attempt to build the static site
run: bundle exec middleman build --bail
- name: Push the static site to stage
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/push')
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }}
STAGE_S3_BUCKET: ${{ secrets.STAGE_S3_BUCKET }}
run: aws s3 sync build $STAGE_S3_BUCKET/build/
- uses: actions/github-script@v4.0.2
name: comment-on-pr
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/push') && ! failure()
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Deployed to stage!"
});