Update versions.json #90
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: CI | |
on: ["push", "pull_request"] | |
env: | |
FORCE_COLOR: 1 | |
EARTHLY_STRICT: "true" | |
DEPLOY: "${{ ( github.repository_owner == 'HaxeFoundation' ) && ( github.event_name == 'push' ) && ( ( github.ref == 'refs/heads/staging' ) || ( github.ref == 'refs/heads/master' ) ) }}" | |
jobs: | |
job: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/checkout@v3 | |
with: | |
repository: HaxeFoundation/HaxeManual | |
path: manual | |
- uses: earthly/actions-setup@v1 | |
with: | |
version: "0.7.2" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
run: earthly +generate --GIT_BRANCH=${{ github.ref_name }} | |
- name: Create .envrc | |
if: success() && env.DEPLOY == 'true' | |
run: | | |
cat > .envrc <<EOT | |
export AWS_DEFAULT_REGION='${{ vars.AWS_DEFAULT_REGION }}' | |
export AWS_ACCESS_KEY_ID='${{ vars.AWS_ACCESS_KEY_ID }}' | |
export AWS_SECRET_ACCESS_KEY='$AWS_SECRET_ACCESS_KEY' | |
export S3_BUCKET='${{ vars.S3_BUCKET }}' | |
export GIT_BRANCH='${{ github.ref_name }}' | |
export CLOUDFRONT_DISTRIBUTION_ID_STAGING='${{ vars.CLOUDFRONT_DISTRIBUTION_ID_STAGING }}' | |
export CLOUDFRONT_DISTRIBUTION_ID_MASTER='${{ vars.CLOUDFRONT_DISTRIBUTION_ID_MASTER }}' | |
EOT | |
env: | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Deploy | |
if: success() && env.DEPLOY == 'true' | |
run: earthly +deploy --GIT_BRANCH=${{ github.ref_name }} | |
env: | |
EARTHLY_SECRET_FILES: .envrc=.envrc |