Skip to content

Misc improvements (#6) #32

Misc improvements (#6)

Misc improvements (#6) #32

Workflow file for this run

name: Deploy
on:
pull_request: {}
push:
branches:
- main
env:
PANTS_CONFIG_FILES: +['pants.ci.toml']
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Initialize Pants
uses: pantsbuild/actions/init-pants@main
with:
# cache0 makes it easy to bust the cache if needed
gha-cache-key: cache0-py${{ matrix.python_version }}
named-caches-hash: ${{ hashFiles('lockfiles/*.json', '**/something-else.lock') }}
cache-lmdb-store: 'true'
- name: Check BUILD files
run: |
pants tailor --check update-build-files --check ::
# - name: Lint
# run: |
# pants lint ::
- name: Test
run: |
pants test ::
- name: Package
run: |
# We also smoke test that our release process will work by running `package`.
pants package ::
- name: Log in to registry
if: github.ref_name == 'main'
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Publish
if: github.ref_name == 'main'
run: |
pants publish src/docker::
- name: Upload pants log
uses: actions/upload-artifact@v3
with:
name: pants-log
path: .pants.d/pants.log
deploy:
if: github.ref_name == 'main'
runs-on: ubuntu-latest
environment: leaderboard.fly.dev
needs: test
steps:
- name: Check out repository code
uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}