clean up scripts #69
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: ['main'] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
actions: write | |
contents: read | |
env: | |
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} | |
EARTHLY_ORG: ${{ secrets.EARTHLY_ORG }} | |
EARTHLY_SATELLITE: ${{ secrets.EARTHLY_SATELLITE }} | |
EARTHLY_CI: true | |
GITHUB_ACTIONS: true # Better earthly outputs in github actions | |
FORCE_COLOR: 1 | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Expose EARTHLY_VERSION from devbox.lock | |
run: | | |
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable | |
EARTHLY_VERSION="$(jq -r ".packages[\"earthly@latest\"].version" devbox.lock)" | |
echo "EARTHLY_VERSION=$EARTHLY_VERSION" >> "$GITHUB_ENV" | |
- name: Install earthly | |
uses: earthly/actions-setup@v1 | |
with: | |
version: ${{ env.EARTHLY_VERSION }} | |
- name: Deploy | |
run: | |
earthly --allow-privileged --secret FLY_API_TOKEN +ci-deploy --COMMIT_SHA="$COMMIT_SHA" --FLY_APP_NAME="$FLY_APP_NAME" --AUTHN_URL="$AUTHN_URL" | |
env: | |
COMMIT_SHA: ${{ github.sha }} | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
FLY_APP_NAME: ${{ secrets.FLY_APP_NAME }} | |
AUTHN_URL: ${{ secrets.AUTHN_URL }} |