55 branches : [master]
66 paths :
77 - ' **.py'
8- - .github/build_latest_container.yaml
8+ - .github/workflows/ build_latest_container.yaml
99 - Dockerfile.prod
1010 release :
1111 types : [published]
1212
1313env :
1414 REGISTRY : ghcr.io
15+ PYTHON_VERSION : ' 3.10'
16+
17+ permissions :
18+ contents : read
19+ packages : write
1520
1621jobs :
1722 lint :
1823 runs-on : ubuntu-latest
1924 steps :
20- - uses : actions/checkout@v3.0.2
25+ - uses : actions/checkout@v4
2126 with :
2227 fetch-depth : 0
2328 set-safe-directory : true
29+ - name : Set up Python
30+ uses : actions/setup-python@v5
31+ with :
32+ python-version : ${{ env.PYTHON_VERSION }}
2433 - name : Check git version and our path
2534 run : |
2635 git config --global --add safe.directory "$GITHUB_WORKSPACE"
27- - uses : ptxmac/yapf-action@master
28- with :
29- args : --recursive --verbose
36+ - name : Install yapf
37+ run : |
38+ python -m pip install --upgrade pip
39+ pip install yapf
40+ - name : Run yapf
41+ run : |
42+ yapf --recursive --verbose --diff .
3043 build :
3144 runs-on : ubuntu-latest
3245 needs : lint
3649 username : ${{ github.repository_owner }}
3750 password : ${{ secrets.REGISTRY_TOKEN }}
3851 steps :
39- - uses : actions/checkout@v3.0.2
52+ - uses : actions/checkout@v4
4053 with :
4154 fetch-depth : 0
4255 set-safe-directory : true
@@ -46,15 +59,15 @@ jobs:
4659 - name : Install dependencies
4760 run : |
4861 python3 -m pip install --upgrade pip wheel setuptools setuptools-scm
49- python3 -m pip install virtualenv
5062 python3 -m pip install build
5163 - name : Build package
5264 run : python3 -m build
5365 - name : Install snow
5466 run : pip install dist/*.tar.gz
5567 - name : Upload artifacts
56- uses : actions/upload-artifact@v3
68+ uses : actions/upload-artifact@v4
5769 with :
70+ name : snow-artifacts
5871 path : dist/*
5972 - name : Run commands to test that everything is finished
6073 run : |
@@ -65,18 +78,32 @@ jobs:
6578 needs : build
6679 steps :
6780 - name : Checkout Code
68- uses : actions/checkout@v1
81+ uses : actions/checkout@v4
82+ - name : Free up disk space
83+ run : |
84+ sudo rm -rf /usr/share/dotnet
85+ sudo rm -rf /opt/ghc
86+ sudo rm -rf /opt/hostedtoolcache/CodeQL
87+ sudo rm -rf "$AGENT_TOOLSDIRECTORY"
88+ df -h
6989 - name : Login to GitHub Container Registry
70- uses : docker/login-action@v1
90+ uses : docker/login-action@v3
7191 with :
7292 registry : ${{ env.REGISTRY }}
7393 username : ${{ github.repository_owner }}
7494 password : ${{ secrets.REGISTRY_TOKEN }}
7595 - name : Setup Docker Buildx
76- uses : docker/setup-buildx-action@v2
96+ uses : docker/setup-buildx-action@v3
97+ - name : Prune Docker system
98+ run : docker system prune -af --volumes || true
7799 - name : Build and Push Docker Image
78- uses : docker/build-push-action@v2
100+ uses : docker/build-push-action@v5
79101 with :
102+ context : .
80103 file : ./Dockerfile.prod
81- push : true # Will only build if this is not here
104+ push : true
82105 tags : ${{ env.REGISTRY }}/${{ github.repository }}:latest
106+ cache-from : type=gha
107+ cache-to : type=gha,mode=max
108+ build-args : |
109+ BUILDKIT_INLINE_CACHE=1
0 commit comments