September 2024 #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
push: | |
branches: | |
- "master" | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
env: | |
RACK_ENV: stage | |
ENV_FILE: .env.stage | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
S3_BUCKET: ${{ secrets.STAGE_S3_BUCKET }} | |
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGE_CLOUDFRONT_DISTRIBUTION_ID }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.6' | |
- name: Build | |
run: | | |
cp $ENV_FILE .env | |
gem install bundler -v 1.17.3 | |
bundle install --jobs 4 --retry 3 | |
yarn install --non-interactive | |
wget https://github.com/jgm/pandoc/releases/download/1.19.2.1/pandoc-1.19.2.1-1-amd64.deb | |
sudo dpkg -i pandoc-1.19.2.1-1-amd64.deb | |
rm pandoc-1.19.2.1-1-amd64.deb | |
bundle exec middleman build -e $RACK_ENV | |
- name: Deploy | |
uses: reggionick/s3-deploy@v3 | |
with: | |
folder: build | |
bucket: ${{ secrets.STAGE_S3_BUCKET }} | |
bucket-region: ${{ secrets.S3_BUCKET_REGION }} | |
dist-id: ${{ secrets.STAGE_CLOUDFRONT_DISTRIBUTION_ID }} | |
invalidation: / | |
delete-removed: true | |
#- name: Notify Slack | |
# uses: adamkdean/[email protected] | |
# with: | |
# channel: '#ops' | |
# username: 'GitHub Actions' | |
# color: 'good' | |
# text: 'A new version of the stats portal has been deployed to stage.' |