Updating sponsors (#494) #1083
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] | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: 'Branch, tag or commit SHA1 to build' | |
required: true | |
type: string | |
default: master | |
## cancel ongoing runs if the workflow is triggered | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'crystal-lang' | |
env: | |
O: _site | |
COMPOSE_FILE: "docker-compose.yml:docker-compose.ci.yml" | |
GIT_REF: "${{ (github.event_name == 'workflow_dispatch' && inputs.ref) || github.ref }}" | |
steps: | |
- name: Checkout ${{ env.GIT_REF }} | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.GIT_REF }} | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/bundle | |
tmp/.htmlproofer | |
key: gem-${{ hashFiles('Gemfile.lock') }} | |
restore-keys: gem- | |
- name: Build website | |
run: | | |
docker compose run --rm web /bin/bash -c "bundle check || bundle install --jobs=3" | |
docker compose run -e O --rm web make build | |
sudo chown -R $(whoami):$(whoami) $O | |
- name: Fetch install.sh | |
run: | | |
make $O/install.sh | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Sync to S3 | |
run: | | |
aws s3 sync ./$O s3://crystal-website --delete | |
./scripts/set-legacy-url-redirects.bash crystal-website < ./_data/legacy_non_pretty_urls.txt |