experiment with github actions #60
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 to AWS (release) | |
on: | |
push: | |
branches: | |
- "main" | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Determine version number | |
run: > | |
set -e; echo "BEHAVE_VERSION=$(python determine_version_number.py)" >> $GITHUB_ENV | |
- name: Test | |
run: echo $BEHAVE_VERSION | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
buildkitd-flags: --debug | |
- name: restore libavjs cache | |
uses: actions/cache@v3 | |
with: | |
key: libavjs-files--${{ hashFiles('libav.js/*') }} | |
path: public/app/bundled/libavjs/ | |
- name: update cache timestamps | |
# this will update the timestamps on the cache | |
# this is necessary since the Dockerfile will always be newer (gets | |
# checkout timestamp). | |
# However because of the hash, cache only gets restored if the Dockerfile | |
# is unchanged. | |
run: make -t public/app/bundled/libavjs/version.txt || true | |
- name: Build | |
run: DOCKER="docker buildx" DOCKER_TMPDIR=/tmp ENVIRONMENT=production make lint all | |
- name: Set AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::442430797903:role/behave-claude-apps-com-UploadRole-bcTUZbepmRpa | |
- name: Deploy | |
run: aws s3 sync --delete --exclude=beta/\* --content-encoding utf8 public s3://behave.claude-apps.com/website/ |